From: Tony Lindgren Date: Tue, 7 Aug 2007 12:20:00 +0000 (-0700) Subject: ARM: OMAP: Warn on disabling clocks with no users X-Git-Tag: v2.6.23-omap1~284 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fc51c39a5625cacf904656a648fcbd77c9e7ee58;p=linux-2.6-omap-h63xx.git ARM: OMAP: Warn on disabling clocks with no users Instead of BUG(), warn on disabling clocks with no users. Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index cbcc8fe30ef..20a789df60d 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c @@ -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);