提交 3ef48fac 编写于 作者: R Russell King 提交者: Russell King

[ARM] omap: fix omap1 clock usecount decrement bug

Same fix as per a7f8c599, but for OMAP1 instead.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册