From patchwork Fri May 24 07:33:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-Philippe_Fran=C3=83=C2=A7ois?= X-Patchwork-Id: 2609691 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 7DCACDF24C for ; Fri, 24 May 2013 07:33:57 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfmVf-00085O-T9; Fri, 24 May 2013 07:33:56 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfmVc-0007RD-V6; Fri, 24 May 2013 07:33:52 +0000 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfmVZ-0007Qg-Rd for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2013 07:33:50 +0000 Received: by mail-we0-f170.google.com with SMTP id u59so2101524wes.1 for ; Fri, 24 May 2013 00:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=VHgGCzBsHQS5ng2bPLikgTid5KD/nr25JmEeDAlAzE8=; b=vxc7+FNZZ0bSCM3CxANcnW9oj3qDYe5X4HcozCQ3u9iU+eIOMSLmADyHATyscjfpZ8 T74oV13q0Xfnq7FCIFYgQoYGbibQYrVAgB4ZPjpGFLN+GnMD0yCo2j7Jd6KiOuR9I9Z9 hCRNbwiErm8rWVr/0w9IdtmXu4H6QgR45cshziFJdVC3FIn9nNQC4A2S4SeePOVlJ43U plwOo7h+tS1HVXC/S4UKvu8x5/p2M5NxntAIhLwpJibjgYrVUWZhFdxmoLd3Ttqi7/nS /wRTqvsCn7/oco85xCksO7PKATAv47ZL49/ch4nDKDfiAicILwQdMKBwmSo/gaIOAyQc ndcw== X-Received: by 10.180.81.169 with SMTP id b9mr50090649wiy.12.1369380807174; Fri, 24 May 2013 00:33:27 -0700 (PDT) Received: from localhost.localdomain (vil35-1-82-67-117-55.fbx.proxad.net. [82.67.117.55]) by mx.google.com with ESMTPSA id w8sm2848818wiz.0.2013.05.24.00.33.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 24 May 2013 00:33:26 -0700 (PDT) From: Jean-Philippe Francois To: paul@pwsan.com, tony@atomide.com Subject: [PATCH 1/1] ARM : omap3 : fix wrong container_of in clock36xx.c Date: Fri, 24 May 2013 09:33:05 +0200 Message-Id: <1369380785-23374-1-git-send-email-jp.francois@cynove.com> X-Mailer: git-send-email 1.7.0.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130524_033350_095035_8E4BAA48 X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jphilippe.francois[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: =?UTF-8?q?Jean-Philippe=20Fran=C3=A7ois?= , linux-omap@vger.kernel.org, mturquette@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org omap36xx_pwrdn_clk_enable_with_hsdiv_restore expects the parent hw of the clock to be a clk_hw_omap. However, looking at cclock3xxx_data.c, all concerned clock have parent defined as clk_divider. Fix the function to use clk_divider. Tested with 3.9 on dm3730. Signed-off-by: Jean-Philippe François Index: b/arch/arm/mach-omap2/clock36xx.c =================================================================== --- a/arch/arm/mach-omap2/clock36xx.c +++ b/arch/arm/mach-omap2/clock36xx.c @@ -20,11 +20,12 @@ #include #include +#include #include #include "clock.h" #include "clock36xx.h" - +#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw) /** * omap36xx_pwrdn_clk_enable_with_hsdiv_restore - enable clocks suffering @@ -39,29 +40,28 @@ */ int omap36xx_pwrdn_clk_enable_with_hsdiv_restore(struct clk_hw *clk) { - struct clk_hw_omap *parent; + struct clk_divider *parent; struct clk_hw *parent_hw; - u32 dummy_v, orig_v, clksel_shift; + u32 dummy_v, orig_v; int ret; /* Clear PWRDN bit of HSDIVIDER */ ret = omap2_dflt_clk_enable(clk); parent_hw = __clk_get_hw(__clk_get_parent(clk->clk)); - parent = to_clk_hw_omap(parent_hw); + parent = to_clk_divider(parent_hw); /* Restore the dividers */ if (!ret) { - clksel_shift = __ffs(parent->clksel_mask); - orig_v = __raw_readl(parent->clksel_reg); + orig_v = __raw_readl(parent->reg); dummy_v = orig_v; /* Write any other value different from the Read value */ - dummy_v ^= (1 << clksel_shift); - __raw_writel(dummy_v, parent->clksel_reg); + dummy_v ^= (1 << parent->shift); + __raw_writel(dummy_v, parent->reg); /* Write the original divider */ - __raw_writel(orig_v, parent->clksel_reg); + __raw_writel(orig_v, parent->reg); } return ret;