From: wu guoxing Date: Tue, 27 Dec 2011 05:32:43 +0000 (+0800) Subject: ENGR00170945:mx6: clk: __clk_disable operates only when usecount > 0 X-Git-Tag: v3.0.35-fsl_4.1.0~1862 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2813c0124eb891728299bd37a96c45ff9e32f2a5;p=karo-tx-linux.git ENGR00170945:mx6: clk: __clk_disable operates only when usecount > 0 in __clk_disable, check usecount, if it is 0, return, otherwise, the usecount will be un-correct. Signed-off-by: Wu Guoxing --- diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c index 1814cdc237b9..e1923577a9f3 100755 --- a/arch/arm/plat-mxc/clock.c +++ b/arch/arm/plat-mxc/clock.c @@ -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)