Skip to content

Commit

Permalink
[AVR32] Warn, don't BUG if clk_disable is called too many times
Browse files Browse the repository at this point in the history
Print a helpful warning along with a stack dump if clk_disable is
called on a already-disabled clock. Remove the BUG_ON().

Extracted from a patch by David Brownell.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
  • Loading branch information
Haavard Skinnemoen committed Feb 16, 2007
1 parent 7a5fe23 commit 23cebe2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/avr32/mach-at32ap/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ EXPORT_SYMBOL(clk_enable);

static void __clk_disable(struct clk *clk)
{
BUG_ON(clk->users == 0);
if (clk->users == 0) {
printk(KERN_ERR "%s: mismatched disable\n", clk->name);
WARN_ON(1);
return;
}

if (--clk->users == 0 && clk->mode)
clk->mode(clk, 0);
Expand Down

0 comments on commit 23cebe2

Please sign in to comment.