summaryrefslogtreecommitdiffstats
path: root/kernel/power/suspend_test.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-03 23:10:23 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-03 23:10:23 +0200
commitee7f9d7c7c1d0fde6441be495f6f14eae43af2e0 (patch)
treee47d5f4ae1e8f939b0cde3548987d599181ce529 /kernel/power/suspend_test.c
parent97b80e685ffae9a6dc946ab08ed32f1eafda97d7 (diff)
parent057b0a7518e4b8fca26201715996d6d928a62300 (diff)
Merge branch 'pm-sleep'
* pm-sleep: PM / hibernate: fixed typo in comment PM / sleep: unregister wakeup source when disabling device wakeup PM / sleep: Introduce command line argument for sleep state enumeration PM / sleep: Use valid_state() for platform-dependent sleep states only PM / sleep: Add state field to pm_states[] entries PM / sleep: Update device PM documentation to cover direct_complete PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily PM / hibernate: Fix memory corruption in resumedelay_setup() PM / hibernate: convert simple_strtoul to kstrtoul PM / hibernate: Documentation: Fix script for unswapping PM / hibernate: no kernel_power_off when pm_power_off NULL PM / hibernate: use unsigned local variables in swsusp_show_speed()
Diffstat (limited to 'kernel/power/suspend_test.c')
-rw-r--r--kernel/power/suspend_test.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/kernel/power/suspend_test.c b/kernel/power/suspend_test.c
index 9b2a1d58558..269b097e78e 100644
--- a/kernel/power/suspend_test.c
+++ b/kernel/power/suspend_test.c
@@ -92,13 +92,13 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
}
if (state == PM_SUSPEND_MEM) {
- printk(info_test, pm_states[state]);
+ printk(info_test, pm_states[state].label);
status = pm_suspend(state);
if (status == -ENODEV)
state = PM_SUSPEND_STANDBY;
}
if (state == PM_SUSPEND_STANDBY) {
- printk(info_test, pm_states[state]);
+ printk(info_test, pm_states[state].label);
status = pm_suspend(state);
}
if (status < 0)
@@ -136,18 +136,16 @@ static char warn_bad_state[] __initdata =
static int __init setup_test_suspend(char *value)
{
- unsigned i;
+ suspend_state_t i;
/* "=mem" ==> "mem" */
value++;
- for (i = 0; i < PM_SUSPEND_MAX; i++) {
- if (!pm_states[i])
- continue;
- if (strcmp(pm_states[i], value) != 0)
- continue;
- test_state = (__force suspend_state_t) i;
- return 0;
- }
+ for (i = PM_SUSPEND_MIN; i < PM_SUSPEND_MAX; i++)
+ if (!strcmp(pm_states[i].label, value)) {
+ test_state = pm_states[i].state;
+ return 0;
+ }
+
printk(warn_bad_state, value);
return 0;
}
@@ -164,8 +162,8 @@ static int __init test_suspend(void)
/* PM is initialized by now; is that state testable? */
if (test_state == PM_SUSPEND_ON)
goto done;
- if (!valid_state(test_state)) {
- printk(warn_bad_state, pm_states[test_state]);
+ if (!pm_states[test_state].state) {
+ printk(warn_bad_state, pm_states[test_state].label);
goto done;
}