Skip to content

Commit

Permalink
[ARM] omap: fix omap1 clock usecount decrement bug
Browse files Browse the repository at this point in the history
Same fix as per a7f8c59, but for OMAP1 instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Apr 6, 2009
1 parent 0221c81 commit 3ef48fa
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions arch/arm/mach-omap1/clock.c
Original file line number Diff line number Diff line change
@@ -590,27 +590,28 @@ static void omap1_init_ext_clk(struct clk * clk)
static int omap1_clk_enable(struct clk *clk)
{
int ret = 0;

if (clk->usecount++ == 0) {
if (likely(clk->parent)) {
if (clk->parent) {
ret = omap1_clk_enable(clk->parent);

if (unlikely(ret != 0)) {
clk->usecount--;
return ret;
}
if (ret)
goto err;

if (clk->flags & CLOCK_NO_IDLE_PARENT)
omap1_clk_deny_idle(clk->parent);
}

ret = clk->ops->enable(clk);

if (unlikely(ret != 0) && clk->parent) {
omap1_clk_disable(clk->parent);
clk->usecount--;
if (ret) {
if (clk->parent)
omap1_clk_disable(clk->parent);
goto err;
}
}
return ret;

err:
clk->usecount--;
return ret;
}

0 comments on commit 3ef48fa

Please sign in to comment.