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: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
if (++clk->usecount > 1)
return 0;
if (++clk->usecount > 1)
return 0;
+ omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
+
if (clk->parent)
ret = omap2_clk_enable(clk->parent);
if (ret != 0) {
clk->usecount--;
if (clk->parent)
ret = omap2_clk_enable(clk->parent);
if (ret != 0) {
clk->usecount--;
+ omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
- omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
-
ret = _omap2_clk_enable(clk);
if (ret != 0) {
ret = _omap2_clk_enable(clk);
if (ret != 0) {