]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/plat-omap/clock.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
[linux-2.6-omap-h63xx.git] / arch / arm / plat-omap / clock.c
index 32a533ba9adaa519dff8ef02c8d1a335b7e45e30..2db5580048d8d254ddc12c3af1fb79152c355d85 100644 (file)
@@ -21,9 +21,9 @@
 #include <linux/clk.h>
 #include <linux/mutex.h>
 #include <linux/platform_device.h>
+#include <linux/cpufreq.h>
 
 #include <asm/io.h>
-#include <asm/semaphore.h>
 
 #include <asm/arch/clock.h>
 
@@ -135,9 +135,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);