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: 2583581 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 53B5EDF215 for ; Fri, 17 May 2013 15:52:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755519Ab3EQPwH (ORCPT ); Fri, 17 May 2013 11:52:07 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:42281 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754985Ab3EQPwG (ORCPT ); Fri, 17 May 2013 11:52:06 -0400 Received: by mail-wi0-f171.google.com with SMTP id hq7so557872wib.10 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 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] 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: 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;