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: 2609681 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id DC362DF24C for ; Fri, 24 May 2013 07:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757372Ab3EXHd3 (ORCPT ); Fri, 24 May 2013 03:33:29 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:44349 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756887Ab3EXHd2 (ORCPT ); Fri, 24 May 2013 03:33:28 -0400 Received: by mail-wi0-f180.google.com with SMTP id hn14so2526348wib.13 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 Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, mturquette@linaro.org, =?UTF-8?q?Jean-Philippe=20Fran=C3=A7ois?= 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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 --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;