From: Rajendra Nayak Date: Wed, 22 Dec 2010 04:31:28 +0000 (-0700) Subject: OMAP2+: hwmod: Disable clocks when hwmod enable fails X-Git-Tag: accepted/tizen/common/20141203.182822~9281^2~15^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2dd7e09db3e18e4c053810b72fe026685d9bf0c;p=platform%2Fkernel%2Flinux-arm64.git OMAP2+: hwmod: Disable clocks when hwmod enable fails In cases where a module (hwmod) does not become accesible on enabling the main clocks (can happen if there are external clocks needed for the module to become accesible), make sure the clocks are not left enabled. This ensures that when the requisite external dependencies are met a omap_hwmod_enable and omap_hwmod_idle/shutdown would rightly enable and disable clocks using clk framework. Leaving the clocks enabled in the error case causes additional usecounting at the clock framework level leaving the clock enabled forever. Signed-off-by: Rajendra Nayak Signed-off-by: Benoit Cousson Signed-off-by: Paul Walmsley Cc: Kevin Hilman --- diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 91b011e..c576121 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1233,6 +1233,7 @@ static int _enable(struct omap_hwmod *oh) _enable_sysc(oh); } } else { + _disable_clocks(oh); pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", oh->name, r); }