]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP2/3 clock: omap2_clk_enable(): fix logic
authorPaul Walmsley <paul@pwsan.com>
Wed, 7 Jan 2009 15:23:46 +0000 (17:23 +0200)
committerTony Lindgren <tony@atomide.com>
Wed, 7 Jan 2009 15:23:46 +0000 (17:23 +0200)
Rearrange the parent clock enable status check code so it actually makes
sense.  No functional change.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clock.c

index a9a2bbf10f70d31937eabe22d939750f8668b9ac..413fb684e9c43fda6d1bcd8e87c9761750f3c91d 100644 (file)
@@ -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);