]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00170945:mx6: clk: __clk_disable operates only when usecount > 0
authorwu guoxing <b39297@freescale.com>
Tue, 27 Dec 2011 05:32:43 +0000 (13:32 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:10:26 +0000 (14:10 +0200)
in __clk_disable, check usecount, if it is 0, return, otherwise,
the usecount will be un-correct.

Signed-off-by: Wu Guoxing <b39297@freescale.com>
arch/arm/plat-mxc/clock.c

index 1814cdc237b9b28a717adfc93238501d5230cff5..e1923577a9f3adfb91af9804b07744605f8a0194 100755 (executable)
@@ -65,7 +65,11 @@ static void __clk_disable(struct clk *clk)
 {
        if (clk == NULL || IS_ERR(clk))
                return;
-       WARN_ON(!clk->usecount);
+
+       if (!clk->usecount) {
+               WARN(1, "clock enable/disable mismatch!\n");
+               return;
+       }
 
        if (!(--clk->usecount)) {
                if (clk->disable)