From patchwork Fri May 17 15:51:26 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: 2583591 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 A8E4ADF215 for ; Fri, 17 May 2013 15:52:37 +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 1UdMxQ-0006FX-FI; Fri, 17 May 2013 15:52:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdMxN-0000fq-ME; Fri, 17 May 2013 15:52:33 +0000 Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdMxK-0000f0-Ab for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2013 15:52:31 +0000 Received: by mail-wg0-f41.google.com with SMTP id y10so665313wgg.0 for ; Fri, 17 May 2013 08:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=VHgGCzBsHQS5ng2bPLikgTid5KD/nr25JmEeDAlAzE8=; b=Ujbd8dJ60VOBQgK6Q7rJyUdzr3eGnXp+vFLM/Q47Lw14Pm+EHDM+8n89r+n7iVXkCW aeYcZFaK3LL5MJC+sfj1EibfkmXAKgF97K44mKT/exw5iOtQg2EjaeVHUlCY5ds1YSDh MXdCYiRO63SdxmdJiaZVXuJHL4BS7M2fPrtdzKB02YiaQEbZNJbhIl2F0k70PqhLp4Dj T/YGFFjHV+sElvJKJB1g1UqowokBAha2IY9gNXPrfAf1di8FZdp489j/sNmGCTX2lmiw e4nrf6vQgIYrVbIITz7YX8ENo5S5eMb2nSzVBspASuxbeySUPB6aXZP/LusrPwoDnU3F rUHw== X-Received: by 10.180.37.109 with SMTP id x13mr34698776wij.20.1368805924702; Fri, 17 May 2013 08:52:04 -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 ay7sm10262581wib.9.2013.05.17.08.52.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 May 2013 08:52:03 -0700 (PDT) From: Jean-Philippe Francois To: paul@pwsan.com Subject: [PATCH] ARM : omap3 : fix wrong container_of in clock36xx.c Date: Fri, 17 May 2013 17:51:26 +0200 Message-Id: <1368805886-26085-1-git-send-email-jp.francois@cynove.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130517_115230_511364_38E07E62 X-CRM114-Status: UNSURE ( 9.65 ) 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;