]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
ARM: OMAP3: PM: cpuidle: default to C1 in next_valid_state
authorJean Pihet <jean.pihet@newoldbits.com>
Fri, 1 Jun 2012 15:11:06 +0000 (17:11 +0200)
committerKevin Hilman <khilman@ti.com>
Mon, 25 Jun 2012 18:24:24 +0000 (11:24 -0700)
If the next state is no found in the next_valid_state function,
fallback to the default value of C1 (which is state 0).
This prevents the use of a bogus state -1 in the rest of the cpuidle
code.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/cpuidle34xx.c

index 207bc1c7759f1bb66b986d0ff1dbadd8c2b01925..f619a928f01ed79e1e58c2c0e2bc5a05a0ed5050 100644 (file)
@@ -178,7 +178,7 @@ static int next_valid_state(struct cpuidle_device *dev,
        u32 mpu_deepest_state = PWRDM_POWER_RET;
        u32 core_deepest_state = PWRDM_POWER_RET;
        int idx;
-       int next_index = -1;
+       int next_index = 0; /* C1 is the default value */
 
        if (enable_off_mode) {
                mpu_deepest_state = PWRDM_POWER_OFF;
@@ -209,12 +209,6 @@ static int next_valid_state(struct cpuidle_device *dev,
                }
        }
 
-       /*
-        * C1 is always valid.
-        * So, no need to check for 'next_index == -1' outside
-        * this loop.
-        */
-
        return next_index;
 }