Skip to content

Commit

Permalink
OMAP: hwmod: Fix omap_hwmod_reset wrong state test
Browse files Browse the repository at this point in the history
The reset function wrongly used the state flag as a bit mask and was trying
to re-enable after a reset.

hwmod is still enabled for the PRCM point of view after a softreset
so there is no need to re-enable.

Remove the state check from omap_hwmod_reset since the _reset
function is checking that as well and in addition can generate
a warning

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
[b-cousson@ti.com: remove the wrong test, remove the re-enable]
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Rajendra Nayak <rnayak@ti.com>
  • Loading branch information
Liam Girdwood authored and Paul Walmsley committed Sep 21, 2010
1 parent 3827f94 commit 9b57911
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,19 +1434,17 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh)
*
* Under some conditions, a driver may wish to reset the entire device.
* Called from omap_device code. Returns -EINVAL on error or passes along
* the return value from _reset()/_enable().
* the return value from _reset().
*/
int omap_hwmod_reset(struct omap_hwmod *oh)
{
int r;

if (!oh || !(oh->_state & _HWMOD_STATE_ENABLED))
if (!oh)
return -EINVAL;

mutex_lock(&omap_hwmod_mutex);
r = _reset(oh);
if (!r)
r = _omap_hwmod_enable(oh);
mutex_unlock(&omap_hwmod_mutex);

return r;
Expand Down

0 comments on commit 9b57911

Please sign in to comment.