Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23cebe22 authored by Haavard Skinnemoen's avatar Haavard Skinnemoen
Browse files

[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: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
parent 7a5fe238
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -63,7 +63,11 @@ EXPORT_SYMBOL(clk_enable);


static void __clk_disable(struct clk *clk)
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)
	if (--clk->users == 0 && clk->mode)
		clk->mode(clk, 0);
		clk->mode(clk, 0);