diff options
| author | Olof Johansson <olof@lixom.net> | 2013-01-27 22:07:11 -0800 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2013-01-27 22:07:20 -0800 |
| commit | 6b914c998787d65022e80d6262dfd0edef58cadb (patch) | |
| tree | ec9d9605ae08e6e40664c4302a181979ab4fe1d3 /drivers/cpuidle/cpuidle.c | |
| parent | 1f87a404d02a96519284e1928445ca5cfe9667db (diff) | |
| parent | 949db153b6466c6f7cad5a427ecea94985927311 (diff) | |
| download | olio-linux-3.10-6b914c998787d65022e80d6262dfd0edef58cadb.tar.xz olio-linux-3.10-6b914c998787d65022e80d6262dfd0edef58cadb.zip | |
Merge tag 'v3.8-rc5' into next/cleanup
Linux 3.8-rc5
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/cpuidle/cpuidle.c')
| -rw-r--r-- | drivers/cpuidle/cpuidle.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index fb4a7dd57f9..e1f6860e069 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -69,24 +69,15 @@ int cpuidle_play_dead(void) { struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices); struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); - int i, dead_state = -1; - int power_usage = INT_MAX; + int i; if (!drv) return -ENODEV; /* Find lowest-power state that supports long-term idle */ - for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) { - struct cpuidle_state *s = &drv->states[i]; - - if (s->power_usage < power_usage && s->enter_dead) { - power_usage = s->power_usage; - dead_state = i; - } - } - - if (dead_state != -1) - return drv->states[dead_state].enter_dead(dev, dead_state); + for (i = drv->state_count - 1; i >= CPUIDLE_DRIVER_STATE_START; i--) + if (drv->states[i].enter_dead) + return drv->states[i].enter_dead(dev, i); return -ENODEV; } |