summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwu guoxing <b39297@freescale.com>2011-12-27 13:32:43 +0800
committerwu guoxing <b39297@freescale.com>2011-12-27 15:18:53 +0800
commit1c6c6e784d77cefb603cef30a014a9eaa20ad40c (patch)
tree9301eb912b2c085c9b7f915a12c2fee03f4cbe74
parentc924e2ebb23dfa30f008144649e43202f75ba468 (diff)
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 <b39297@freescale.com>
-rw-r--r--arch/arm/plat-mxc/clock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
index 1814cdc237b9..e1923577a9f3 100644
--- 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)