From: Paul Walmsley Date: Wed, 7 Jan 2009 15:23:45 +0000 (+0200) Subject: OMAP2/3 clock: omap2_clk_enable(): fix usecount decrement bug X-Git-Tag: v2.6.28-omap1~26 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?p=linux-2.6-omap-h63xx.git;a=commitdiff_plain;h=75fc235fe0f671b56873a75994513df5e665b053 OMAP2/3 clock: omap2_clk_enable(): fix usecount decrement bug If _omap2_clk_enable() fails, the clock's usecount must be decremented by one no matter whether the clock has a parent or not. Signed-off-by: Paul Walmsley Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 55f43d0e688..a9a2bbf10f7 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -502,12 +502,10 @@ int omap2_clk_enable(struct clk *clk) ret = _omap2_clk_enable(clk); if (ret != 0) { + clk->usecount--; omap2_clkdm_clk_disable(clk->clkdm.ptr, clk); - - if (clk->parent) { + if (clk->parent) omap2_clk_disable(clk->parent); - clk->usecount--; - } } return ret;