diff options
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 222c2c0d4a64..1b40d757500d 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -419,20 +419,17 @@ int omap2_clk_enable(struct clk *clk) | |||
419 | int ret = 0; | 419 | int ret = 0; |
420 | 420 | ||
421 | if (clk->usecount++ == 0) { | 421 | if (clk->usecount++ == 0) { |
422 | if (clk->clkdm) | ||
423 | omap2_clkdm_clk_enable(clk->clkdm, clk); | ||
424 | |||
422 | if (clk->parent) { | 425 | if (clk->parent) { |
423 | ret = omap2_clk_enable(clk->parent); | 426 | ret = omap2_clk_enable(clk->parent); |
424 | if (ret) | 427 | if (ret) |
425 | goto err; | 428 | goto err; |
426 | } | 429 | } |
427 | 430 | ||
428 | if (clk->clkdm) | ||
429 | omap2_clkdm_clk_enable(clk->clkdm, clk); | ||
430 | |||
431 | ret = _omap2_clk_enable(clk); | 431 | ret = _omap2_clk_enable(clk); |
432 | if (ret) { | 432 | if (ret) { |
433 | if (clk->clkdm) | ||
434 | omap2_clkdm_clk_disable(clk->clkdm, clk); | ||
435 | |||
436 | if (clk->parent) | 433 | if (clk->parent) |
437 | omap2_clk_disable(clk->parent); | 434 | omap2_clk_disable(clk->parent); |
438 | 435 | ||
@@ -442,6 +439,8 @@ int omap2_clk_enable(struct clk *clk) | |||
442 | return ret; | 439 | return ret; |
443 | 440 | ||
444 | err: | 441 | err: |
442 | if (clk->clkdm) | ||
443 | omap2_clkdm_clk_disable(clk->clkdm, clk); | ||
445 | clk->usecount--; | 444 | clk->usecount--; |
446 | return ret; | 445 | return ret; |
447 | } | 446 | } |