[PATCH 3/8] imx: BUG in clk_disable if the clock isn't enabled
Baruch Siach
baruch at tkos.co.il
Tue Feb 2 02:54:02 EST 2010
Hi Uwe,
On Mon, Feb 01, 2010 at 05:01:30PM +0100, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> Cc: Sascha Hauer <kernel at pengutronix.de>
> Cc: Russell King <linux at arm.linux.org.uk>
> ---
> arch/arm/plat-mxc/clock.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
> index 9e8fbd5..de99681 100644
> --- a/arch/arm/plat-mxc/clock.c
> +++ b/arch/arm/plat-mxc/clock.c
> @@ -56,6 +56,7 @@ static void __clk_disable(struct clk *clk)
> __clk_disable(clk->parent);
> __clk_disable(clk->secondary);
>
> + BUG_ON(!clk->usecount);
> if (!(--clk->usecount) && clk->disable)
> clk->disable(clk);
Is this necessary? Shouldn't WARN_ON be used instead?
Citing include/asm-generic/bug.h: "Don't use BUG() or BUG_ON() unless there's
really no way out..."
baruch
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
More information about the linux-arm-kernel
mailing list