]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/blobdiff - drivers/cpuidle/cpuidle.c
Merge remote-tracking branches 'asoc/fix/amd', 'asoc/fix/arizona', 'asoc/fix/dpcm...
[mirror_ubuntu-disco-kernel.git] / drivers / cpuidle / cpuidle.c
index 17a6dc0e211110f00ac2e73728414f161d5a194f..f996efc56605a3d4739ae0bcac83099fd65b0751 100644 (file)
@@ -79,9 +79,9 @@ static int find_deepest_state(struct cpuidle_driver *drv,
                              bool freeze)
 {
        unsigned int latency_req = 0;
-       int i, ret = -ENXIO;
+       int i, ret = 0;
 
-       for (i = 0; i < drv->state_count; i++) {
+       for (i = 1; i < drv->state_count; i++) {
                struct cpuidle_state *s = &drv->states[i];
                struct cpuidle_state_usage *su = &dev->states_usage[i];
 
@@ -153,7 +153,7 @@ int cpuidle_enter_freeze(struct cpuidle_driver *drv, struct cpuidle_device *dev)
         * be frozen safely.
         */
        index = find_deepest_state(drv, dev, UINT_MAX, 0, true);
-       if (index >= 0)
+       if (index > 0)
                enter_freeze_proper(drv, dev, index);
 
        return index;
@@ -243,7 +243,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
  * @drv: the cpuidle driver
  * @dev: the cpuidle device
  *
- * Returns the index of the idle state.
+ * Returns the index of the idle state.  The return value must not be negative.
  */
 int cpuidle_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 {