Skip to content

Commit

Permalink
OMAP2+: hwmod: Disable clocks when hwmod enable fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rajendra Nayak authored and Paul Walmsley committed Dec 22, 2010
1 parent ce35b24 commit f2dd7e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit f2dd7e0

Please sign in to comment.