diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-04-05 12:27:24 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-04-06 09:57:10 +0100 |
commit | 3ef48fac6e8e2362a4e6ef31dd043c89fe107875 (patch) | |
tree | 0886a3a3ec5c5cd2e49780842d3fdafa52edd21f /arch/arm/mach-omap1/clock.c | |
parent | 0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff) | |
download | linux-3ef48fac6e8e2362a4e6ef31dd043c89fe107875.tar.gz linux-3ef48fac6e8e2362a4e6ef31dd043c89fe107875.tar.bz2 linux-3ef48fac6e8e2362a4e6ef31dd043c89fe107875.zip |
[ARM] omap: fix omap1 clock usecount decrement bug
Same fix as per a7f8c59, but for OMAP1 instead.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap1/clock.c')
-rw-r--r-- | arch/arm/mach-omap1/clock.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index dafe4f71d15f..336e51dc6127 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c @@ -590,27 +590,28 @@ static void omap1_init_ext_clk(struct clk * clk) static int omap1_clk_enable(struct clk *clk) { int ret = 0; + if (clk->usecount++ == 0) { - if (likely(clk->parent)) { + if (clk->parent) { ret = omap1_clk_enable(clk->parent); - - if (unlikely(ret != 0)) { - clk->usecount--; - return ret; - } + if (ret) + goto err; if (clk->flags & CLOCK_NO_IDLE_PARENT) omap1_clk_deny_idle(clk->parent); } ret = clk->ops->enable(clk); - - if (unlikely(ret != 0) && clk->parent) { - omap1_clk_disable(clk->parent); - clk->usecount--; + if (ret) { + if (clk->parent) + omap1_clk_disable(clk->parent); + goto err; } } + return ret; +err: + clk->usecount--; return ret; } |