From 2813c0124eb891728299bd37a96c45ff9e32f2a5 Mon Sep 17 00:00:00 2001 From: wu guoxing Date: Tue, 27 Dec 2011 13:32:43 +0800 Subject: [PATCH] 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 --- arch/arm/plat-mxc/clock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.39.5