aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/driver.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2012-03-26 08:51:26 -0400
committerLen Brown <len.brown@intel.com>2012-03-30 01:55:04 -0400
commitfc850f39ea54c760ce438a601cfea8ab80c4898e (patch)
tree3f413ea8c13cc12f7f6af16bc198a17914695f1b /drivers/cpuidle/driver.c
parent3a53396b0381ec9d5180fd8fe7a681c8ce95fd9a (diff)
cpuidle: use the driver's state_count as default
If the state_count is not initialized for the device use the driver's state count as the default. That will prevent to add it manually in the cpuidle driver initialization routine and will save us from duplicate line of code. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/cpuidle/driver.c')
-rw-r--r--drivers/cpuidle/driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index 284d7af5a9c8..40cd3f3024df 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -47,7 +47,7 @@ static void __cpuidle_register_driver(struct cpuidle_driver *drv)
47 */ 47 */
48int cpuidle_register_driver(struct cpuidle_driver *drv) 48int cpuidle_register_driver(struct cpuidle_driver *drv)
49{ 49{
50 if (!drv) 50 if (!drv || !drv->state_count)
51 return -EINVAL; 51 return -EINVAL;
52 52
53 if (cpuidle_disabled()) 53 if (cpuidle_disabled())