From patchwork Thu Jan 9 14:00:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 23048 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E5B4D216DD for ; Thu, 9 Jan 2014 14:04:57 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id p6sf4668408vbe.10 for ; Thu, 09 Jan 2014 06:04:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=hR+gVEBD6nR+RHn6eMQ605bFnIJECQvesGgWCmvb03g=; b=A7CCF5jk3hNrwUNKW0I53CWmdqhrxlINHzWvRuqp+e/IcUAqIaQpWVs8C3thsHWuvw rNXc0IxwpfGb+D+QOAeGa75znxJ6+/wXllaLWfcuIKPQj3CTtqpM+bGqvXfatomjRomO rU7VrIpKbh28rQqbJ8IQc7F0CNIAiHiYO1AFXey1M1M25U/wCbrtyHW7rbQdbeXMWs1M zUQ8dPdg/7yDkM+KJmXqr3DbN/yhrSUXt358Lg1tnPVD053WnS3u/EHPIc1DbQ+eVaFw 2cgAnBG1v3MtZHUNr99qtPNPNTgy4jEV0vD5HGSS/F+mbgvCe0fP/U/C3ow/oiLAlHvs zk/Q== X-Gm-Message-State: ALoCoQn/wb4HUOFqesl2sizxB7zYu+zdS/yP4h2DwQm4Wk02dRl/uL+7MTo6mxuM5wua1baenACb X-Received: by 10.236.120.17 with SMTP id o17mr961165yhh.21.1389276297074; Thu, 09 Jan 2014 06:04:57 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.15.70 with SMTP id v6ls1022626qec.47.gmail; Thu, 09 Jan 2014 06:04:56 -0800 (PST) X-Received: by 10.58.134.40 with SMTP id ph8mr1372165veb.61.1389276296974; Thu, 09 Jan 2014 06:04:56 -0800 (PST) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id xe7si2878259vec.116.2014.01.09.06.04.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 Jan 2014 06:04:56 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id c14so2399416vea.14 for ; Thu, 09 Jan 2014 06:04:56 -0800 (PST) X-Received: by 10.58.73.193 with SMTP id n1mr714440vev.75.1389276296864; Thu, 09 Jan 2014 06:04:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp14482ved; Thu, 9 Jan 2014 06:04:55 -0800 (PST) X-Received: by 10.66.220.198 with SMTP id py6mr3821297pac.21.1389276295159; Thu, 09 Jan 2014 06:04:55 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot3si4011840pac.282.2014.01.09.06.04.54; Thu, 09 Jan 2014 06:04:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756525AbaAIOEa (ORCPT + 5 others); Thu, 9 Jan 2014 09:04:30 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:38705 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756252AbaAIODo (ORCPT ); Thu, 9 Jan 2014 09:03:44 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s09E2o8x016335; Thu, 9 Jan 2014 08:02:50 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s09E2obs025499; Thu, 9 Jan 2014 08:02:50 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Thu, 9 Jan 2014 08:02:49 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s09E12Wa030058; Thu, 9 Jan 2014 08:02:47 -0600 From: Tero Kristo To: , , , , , , CC: , Subject: [PATCHv13 32/40] ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm Date: Thu, 9 Jan 2014 16:00:43 +0200 Message-ID: <1389276051-1326-33-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1389276051-1326-1-git-send-email-t-kristo@ti.com> References: <1389276051-1326-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If the main clock for a hwmod is of basic clock type, it is illegal to type cast this to clk_hw_omap and will result in bogus data. Fixed by checking the clock flags before attempting the type cast. Signed-off-by: Tero Kristo Tested-by: Nishanth Menon Acked-by: Tony Lindgren --- arch/arm/mach-omap2/omap_hwmod.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 8a1b5e0..cc24c95 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -686,6 +686,8 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh) if (oh->clkdm) { return oh->clkdm; } else if (oh->_clk) { + if (__clk_get_flags(oh->_clk) & CLK_IS_BASIC) + return NULL; clk = to_clk_hw_omap(__clk_get_hw(oh->_clk)); return clk->clkdm; }