From patchwork Tue Apr 24 03:18:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [01/11] MXS: Make clk_disable return integer From: Marek Vasut X-Patchwork-Id: 154573 Message-Id: <1335237523-9053-2-git-send-email-marex@denx.de> To: linux-arm-kernel@lists.infradead.org Cc: Marek Vasut , Li Frank-B20596 , Tony Lin , Lin Tony-B19295 , Detlev Zundel , Chen Peter-B29397 , Sascha Hauer , Linux USB , Stefano Babic , Wolfgang Denk , Shawn Guo , Fabio Estevam , Shawn Guo , Subodh Nijsure Date: Tue, 24 Apr 2012 05:18:33 +0200 This allows subsequent USB clock patch to interchange enable() and disable() calls without adding unnecessary switching cruft. Signed-off-by: Marek Vasut Cc: Chen Peter-B29397 Cc: Detlev Zundel Cc: Fabio Estevam Cc: Li Frank-B20596 Cc: Lin Tony-B19295 Cc: Linux USB Cc: Sascha Hauer Cc: Shawn Guo Cc: Shawn Guo Cc: Stefano Babic Cc: Subodh Nijsure Cc: Tony Lin Cc: Wolfgang Denk --- arch/arm/mach-mxs/clock-mx28.c | 7 +++++-- arch/arm/mach-mxs/include/mach/clock.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index cea29c9..43116ba 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -86,7 +86,7 @@ static int _raw_clk_enable(struct clk *clk) return 0; } -static void _raw_clk_disable(struct clk *clk) +static int _raw_clk_disable(struct clk *clk) { u32 reg; @@ -95,6 +95,8 @@ static void _raw_clk_disable(struct clk *clk) reg |= 1 << clk->enable_shift; __raw_writel(reg, clk->enable_reg); } + + return 0; } /* @@ -149,7 +151,7 @@ _CLK_ENABLE_PLL(pll1_clk, PLL1, EN_USB_CLKS) _CLK_ENABLE_PLL(pll2_clk, PLL2, CLKGATE) #define _CLK_DISABLE_PLL(name, r, g) \ -static void name##_disable(struct clk *clk) \ +static int name##_disable(struct clk *clk) \ { \ __raw_writel(BM_CLKCTRL_##r##CTRL0_POWER, \ CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ @@ -161,6 +163,7 @@ static void name##_disable(struct clk *clk) \ __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ \ + return 0; \ } _CLK_DISABLE_PLL(pll0_clk, PLL0, EN_USB_CLKS) diff --git a/arch/arm/mach-mxs/include/mach/clock.h b/arch/arm/mach-mxs/include/mach/clock.h index 592c9ab..21d1fad 100644 --- a/arch/arm/mach-mxs/include/mach/clock.h +++ b/arch/arm/mach-mxs/include/mach/clock.h @@ -50,7 +50,7 @@ struct clk { int (*enable) (struct clk *); /* Function ptr to disable the clock. Leave blank if clock can not be gated. */ - void (*disable) (struct clk *); + int (*disable) (struct clk *); /* Function ptr to set the parent clock of the clock. */ int (*set_parent) (struct clk *, struct clk *); };