diff options
| -rw-r--r-- | include/linux/pm.h | 11 | ||||
| -rw-r--r-- | kernel/power/main.c | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index d54bc441daff..7bfd2d43963e 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -194,11 +194,12 @@ extern void (*pm_idle)(void); extern void (*pm_power_off)(void); enum { - PM_SUSPEND_ON, - PM_SUSPEND_STANDBY, - PM_SUSPEND_MEM, - PM_SUSPEND_DISK, - PM_SUSPEND_MAX, + PM_SUSPEND_ON = 0, + PM_SUSPEND_STANDBY = 1, + /* NOTE: PM_SUSPEND_MEM == PCI_D3hot */ + PM_SUSPEND_MEM = 3, + PM_SUSPEND_DISK = 4, + PM_SUSPEND_MAX = 5, }; enum { diff --git a/kernel/power/main.c b/kernel/power/main.c index 6b5c59cc26ba..2f08a432f0d5 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -230,8 +230,8 @@ static ssize_t state_store(struct subsystem * subsys, const char * buf, size_t n p = memchr(buf, '\n', n); len = p ? p - buf : n; - for (s = &pm_states[state]; *s; s++, state++) { - if (!strncmp(buf, *s, len)) + for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) { + if (*s && !strncmp(buf, *s, len)) break; } if (*s) |
