summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-01-31 11:02:37 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-08 17:50:46 +0000
commit8263e5b31eae2bbf689ff08a7da334329c9f353b (patch)
tree02422180f934dbac1ae16ef63f3825a65636b7b1 /arch/arm
parenta7f8c599c570fc0e2396e8fdccaeeeaefc41dac8 (diff)
downloadblackbird-op-linux-8263e5b31eae2bbf689ff08a7da334329c9f353b.tar.gz
blackbird-op-linux-8263e5b31eae2bbf689ff08a7da334329c9f353b.zip
[ARM] omap: fix clockdomain enable/disable ordering
Based on a patch from Paul Walmsley <paul@pwsan.com>: omap2_clk_enable() should enable a clock's clockdomain before attempting to enable its parent clock's clockdomain. Similarly, in the unlikely event that the parent clock enable fails, the clockdomain should be disabled. linux-omap source commit is 6d6e285e5a7912b1ea68fadac387304c914aaba8. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/clock.c11
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)
int ret = 0;
if (clk->usecount++ == 0) {
+ if (clk->clkdm)
+ omap2_clkdm_clk_enable(clk->clkdm, clk);
+
if (clk->parent) {
ret = omap2_clk_enable(clk->parent);
if (ret)
goto err;
}
- if (clk->clkdm)
- omap2_clkdm_clk_enable(clk->clkdm, clk);
-
ret = _omap2_clk_enable(clk);
if (ret) {
- if (clk->clkdm)
- omap2_clkdm_clk_disable(clk->clkdm, clk);
-
if (clk->parent)
omap2_clk_disable(clk->parent);
@@ -442,6 +439,8 @@ int omap2_clk_enable(struct clk *clk)
return ret;
err:
+ if (clk->clkdm)
+ omap2_clkdm_clk_disable(clk->clkdm, clk);
clk->usecount--;
return ret;
}
OpenPOWER on IntegriCloud