summaryrefslogtreecommitdiff
path: root/arch/avr32/mach-at32ap
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-02-16 15:19:47 +0300
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2007-02-16 15:19:47 +0300
commit23cebe2287474720c2eb0673581056cfb285a69f (patch)
tree88112b4feb2f0d8d5f384f352bc77b6738c6eb3e /arch/avr32/mach-at32ap
parent7a5fe2387925405da0319330986184792ce48ad1 (diff)
downloadlinux-23cebe2287474720c2eb0673581056cfb285a69f.tar.xz
[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')
-rw-r--r--arch/avr32/mach-at32ap/clock.c6
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);
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);