diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-02-13 10:29:24 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-02-17 17:36:10 -0500 |
commit | 93e1ee43a72b11e1b50aab87046c131a836a4456 (patch) | |
tree | 86897d0bec41d2040f371d2bf2951f1f35bf727d /kernel/power/main.c | |
parent | 55ae451918ec62e553f11b6118fec157f90c31c3 (diff) |
PM / Sleep: Make enter_state() in kernel/power/suspend.c static
The enter_state() function in kernel/power/suspend.c should be
static and state_store() in kernel/power/suspend.c should call
pm_suspend() instead of it, so make that happen (which also reduces
code duplication related to suspend statistics).
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index b1e324878d5f..1c12581f1c62 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -291,12 +291,10 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr, | |||
291 | 291 | ||
292 | #ifdef CONFIG_SUSPEND | 292 | #ifdef CONFIG_SUSPEND |
293 | for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) { | 293 | for (s = &pm_states[state]; state < PM_SUSPEND_MAX; s++, state++) { |
294 | if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) | 294 | if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) { |
295 | error = pm_suspend(state); | ||
295 | break; | 296 | break; |
296 | } | 297 | } |
297 | if (state < PM_SUSPEND_MAX && *s) { | ||
298 | error = enter_state(state); | ||
299 | suspend_stats_update(error); | ||
300 | } | 298 | } |
301 | #endif | 299 | #endif |
302 | 300 | ||