aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpuidle/cpuidle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 3e146b2ada4a..a71376a45d8e 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -74,7 +74,7 @@ static cpuidle_enter_t cpuidle_enter_ops;
74/** 74/**
75 * cpuidle_play_dead - cpu off-lining 75 * cpuidle_play_dead - cpu off-lining
76 * 76 *
77 * Only returns in case of an error 77 * Returns in case of an error or no driver
78 */ 78 */
79int cpuidle_play_dead(void) 79int cpuidle_play_dead(void)
80{ 80{
@@ -83,6 +83,9 @@ int cpuidle_play_dead(void)
83 int i, dead_state = -1; 83 int i, dead_state = -1;
84 int power_usage = -1; 84 int power_usage = -1;
85 85
86 if (!drv)
87 return -ENODEV;
88
86 /* Find lowest-power state that supports long-term idle */ 89 /* Find lowest-power state that supports long-term idle */
87 for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) { 90 for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
88 struct cpuidle_state *s = &drv->states[i]; 91 struct cpuidle_state *s = &drv->states[i];