Skip to content

Commit

Permalink
ARM: OMAP: Warn on disabling clocks with no users
Browse files Browse the repository at this point in the history
Instead of BUG(), warn on disabling clocks with no users.

Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tony Lindgren committed May 9, 2008
1 parent c8d2eb8 commit 7cf9577
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion arch/arm/plat-omap/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,17 @@ void clk_disable(struct clk *clk)
return;

spin_lock_irqsave(&clockfw_lock, flags);
BUG_ON(clk->usecount == 0);
if (clk->usecount == 0) {
printk(KERN_ERR "Trying disable clock %s with 0 usecount\n",
clk->name);
WARN_ON(1);
goto out;
}

if (arch_clock->clk_disable)
arch_clock->clk_disable(clk);

out:
spin_unlock_irqrestore(&clockfw_lock, flags);
}
EXPORT_SYMBOL(clk_disable);
Expand Down

0 comments on commit 7cf9577

Please sign in to comment.