Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[deliverable/linux.git] / arch / arm / mach-omap2 / omap_hwmod.c
index 2af6ff63e3b483f197d35761d43dfee90dcafe73..83cb527755a927d705cd2368dfcf5566a3bc0b64 100644 (file)
@@ -2207,15 +2207,15 @@ static int _idle(struct omap_hwmod *oh)
 
        pr_debug("omap_hwmod: %s: idling\n", oh->name);
 
+       if (_are_all_hardreset_lines_asserted(oh))
+               return 0;
+
        if (oh->_state != _HWMOD_STATE_ENABLED) {
                WARN(1, "omap_hwmod: %s: idle state can only be entered from enabled state\n",
                        oh->name);
                return -EINVAL;
        }
 
-       if (_are_all_hardreset_lines_asserted(oh))
-               return 0;
-
        if (oh->class->sysc)
                _idle_sysc(oh);
        _del_initiator_dep(oh, mpu_oh);
@@ -2262,6 +2262,9 @@ static int _shutdown(struct omap_hwmod *oh)
        int ret, i;
        u8 prev_state;
 
+       if (_are_all_hardreset_lines_asserted(oh))
+               return 0;
+
        if (oh->_state != _HWMOD_STATE_IDLE &&
            oh->_state != _HWMOD_STATE_ENABLED) {
                WARN(1, "omap_hwmod: %s: disabled state can only be entered from idle, or enabled state\n",
@@ -2269,9 +2272,6 @@ static int _shutdown(struct omap_hwmod *oh)
                return -EINVAL;
        }
 
-       if (_are_all_hardreset_lines_asserted(oh))
-               return 0;
-
        pr_debug("omap_hwmod: %s: disabling\n", oh->name);
 
        if (oh->class->pre_shutdown) {
This page took 0.024303 seconds and 5 git commands to generate.