Commit 3ef48fac authored by Russell King's avatar Russell King Committed by Russell King

[ARM] omap: fix omap1 clock usecount decrement bug

Same fix as per a7f8c599, but for OMAP1 instead.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 0221c81b
...@@ -590,27 +590,28 @@ static void omap1_init_ext_clk(struct clk * clk) ...@@ -590,27 +590,28 @@ static void omap1_init_ext_clk(struct clk * clk)
static int omap1_clk_enable(struct clk *clk) static int omap1_clk_enable(struct clk *clk)
{ {
int ret = 0; int ret = 0;
if (clk->usecount++ == 0) { if (clk->usecount++ == 0) {
if (likely(clk->parent)) { if (clk->parent) {
ret = omap1_clk_enable(clk->parent); ret = omap1_clk_enable(clk->parent);
if (ret)
if (unlikely(ret != 0)) { goto err;
clk->usecount--;
return ret;
}
if (clk->flags & CLOCK_NO_IDLE_PARENT) if (clk->flags & CLOCK_NO_IDLE_PARENT)
omap1_clk_deny_idle(clk->parent); omap1_clk_deny_idle(clk->parent);
} }
ret = clk->ops->enable(clk); ret = clk->ops->enable(clk);
if (ret) {
if (unlikely(ret != 0) && clk->parent) { if (clk->parent)
omap1_clk_disable(clk->parent); omap1_clk_disable(clk->parent);
clk->usecount--; goto err;
} }
} }
return ret;
err:
clk->usecount--;
return ret; return ret;
} }
......
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