From: Paul Walmsley Date: Wed, 7 Jan 2009 15:23:46 +0000 (+0200) Subject: OMAP2/3 clock: omap2_clk_enable(): fix logic X-Git-Tag: v2.6.28-omap1~25 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=8f0680aff352906b81c49b0450172ffa690b03bb;p=linux-2.6-omap-h63xx.git OMAP2/3 clock: omap2_clk_enable(): fix logic Rearrange the parent clock enable status check code so it actually makes sense. No functional change. Signed-off-by: Paul Walmsley Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index a9a2bbf10f7..413fb684e9c 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -483,20 +483,23 @@ void omap2_clk_disable(struct clk *clk) int omap2_clk_enable(struct clk *clk) { - int ret = 0; + int ret; if (++clk->usecount > 1) return 0; omap2_clkdm_clk_enable(clk->clkdm.ptr, clk); - if (clk->parent) - ret = omap2_clk_enable(clk->parent); + if (clk->parent) { + int parent_ret; - if (ret != 0) { - clk->usecount--; - omap2_clkdm_clk_disable(clk->clkdm.ptr, clk); - return ret; + parent_ret = omap2_clk_enable(clk->parent); + + if (parent_ret != 0) { + clk->usecount--; + omap2_clkdm_clk_disable(clk->clkdm.ptr, clk); + return parent_ret; + } } ret = _omap2_clk_enable(clk);