aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/clock.c')
-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