aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-04-05 07:27:24 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-04-06 04:57:10 -0400
commit3ef48fac6e8e2362a4e6ef31dd043c89fe107875 (patch)
tree0886a3a3ec5c5cd2e49780842d3fdafa52edd21f /arch/arm
parent0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff)
[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')
-rw-r--r--arch/arm/mach-omap1/clock.c21
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)
590static int omap1_clk_enable(struct clk *clk) 590static int omap1_clk_enable(struct clk *clk)
591{ 591{
592 int ret = 0; 592 int ret = 0;
593
593 if (clk->usecount++ == 0) { 594 if (clk->usecount++ == 0) {
594 if (likely(clk->parent)) { 595 if (clk->parent) {
595 ret = omap1_clk_enable(clk->parent); 596 ret = omap1_clk_enable(clk->parent);
596 597 if (ret)
597 if (unlikely(ret != 0)) { 598 goto err;
598 clk->usecount--;
599 return ret;
600 }
601 599
602 if (clk->flags & CLOCK_NO_IDLE_PARENT) 600 if (clk->flags & CLOCK_NO_IDLE_PARENT)
603 omap1_clk_deny_idle(clk->parent); 601 omap1_clk_deny_idle(clk->parent);
604 } 602 }
605 603
606 ret = clk->ops->enable(clk); 604 ret = clk->ops->enable(clk);
607 605 if (ret) {
608 if (unlikely(ret != 0) && clk->parent) { 606 if (clk->parent)
609 omap1_clk_disable(clk->parent); 607 omap1_clk_disable(clk->parent);
610 clk->usecount--; 608 goto err;
611 } 609 }
612 } 610 }
611 return ret;
613 612
613err:
614 clk->usecount--;
614 return ret; 615 return ret;
615} 616}
616 617