diff options
author | Rajendra Nayak <rnayak@ti.com> | 2010-12-21 23:31:28 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-12-21 23:31:28 -0500 |
commit | f2dd7e09db3e18e4c053810b72fe026685d9bf0c (patch) | |
tree | 7ca4e95f815a2ed11bba2a518a7cbf12b3e93017 /arch/arm/mach-omap2 | |
parent | ce35b2446945c506cb02960eab2072f56efdf1c0 (diff) |
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 <rnayak@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 91b011e3a7cb..c576121b58a9 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) | |||
1233 | _enable_sysc(oh); | 1233 | _enable_sysc(oh); |
1234 | } | 1234 | } |
1235 | } else { | 1235 | } else { |
1236 | _disable_clocks(oh); | ||
1236 | pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", | 1237 | pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", |
1237 | oh->name, r); | 1238 | oh->name, r); |
1238 | } | 1239 | } |