diff options
author | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-02-16 07:19:47 -0500 |
---|---|---|
committer | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-02-16 07:19:47 -0500 |
commit | 23cebe2287474720c2eb0673581056cfb285a69f (patch) | |
tree | 88112b4feb2f0d8d5f384f352bc77b6738c6eb3e /arch/avr32/mach-at32ap/clock.c | |
parent | 7a5fe2387925405da0319330986184792ce48ad1 (diff) |
[AVR32] Warn, don't BUG if clk_disable is called too many times
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>
Diffstat (limited to 'arch/avr32/mach-at32ap/clock.c')
-rw-r--r-- | arch/avr32/mach-at32ap/clock.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c index 3d0d1097389f..49e7b12fe710 100644 --- a/arch/avr32/mach-at32ap/clock.c +++ b/arch/avr32/mach-at32ap/clock.c | |||
@@ -63,7 +63,11 @@ EXPORT_SYMBOL(clk_enable); | |||
63 | 63 | ||
64 | static void __clk_disable(struct clk *clk) | 64 | static void __clk_disable(struct clk *clk) |
65 | { | 65 | { |
66 | BUG_ON(clk->users == 0); | 66 | if (clk->users == 0) { |
67 | printk(KERN_ERR "%s: mismatched disable\n", clk->name); | ||
68 | WARN_ON(1); | ||
69 | return; | ||
70 | } | ||
67 | 71 | ||
68 | if (--clk->users == 0 && clk->mode) | 72 | if (--clk->users == 0 && clk->mode) |
69 | clk->mode(clk, 0); | 73 | clk->mode(clk, 0); |