Commit 6d6e285e authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

OMAP2/3 clock: omap2_clk_enable(): fix bugs in clockdomain handling

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.
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 18d4ecba
...@@ -488,16 +488,17 @@ int omap2_clk_enable(struct clk *clk) ...@@ -488,16 +488,17 @@ int omap2_clk_enable(struct clk *clk)
if (++clk->usecount > 1) if (++clk->usecount > 1)
return 0; return 0;
omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
if (clk->parent) if (clk->parent)
ret = omap2_clk_enable(clk->parent); ret = omap2_clk_enable(clk->parent);
if (ret != 0) { if (ret != 0) {
clk->usecount--; clk->usecount--;
omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
return ret; return ret;
} }
omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
ret = _omap2_clk_enable(clk); ret = _omap2_clk_enable(clk);
if (ret != 0) { if (ret != 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment