diff options
author | wu guoxing <b39297@freescale.com> | 2011-12-27 13:32:43 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-07-20 13:19:31 +0800 |
commit | 5c377c309b531ec5790e9f099ef08f5475c08a09 (patch) | |
tree | fec924e13073abcc334d85a5bc0702e34ca46790 | |
parent | 3acc48d2fe2a6f6e244c75fe26523820955c6e1d (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>
-rwxr-xr-x | arch/arm/plat-mxc/clock.c | 6 |
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 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) |