diff options
author | Pavel Machek <pavel@ucw.cz> | 2005-09-04 00:56:57 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 09:06:16 +0200 |
commit | ca078bae813dd46c0f9b102fdfb4a3384641ff48 (patch) | |
tree | e3348f5dcb24159a522941aa2e3ee40bc9e0589b /drivers/base/power/sysfs.c | |
parent | [PATCH] swsusp: fix remaining u32 vs. pm_message_t confusion (diff) | |
download | linux-ca078bae813dd46c0f9b102fdfb4a3384641ff48.tar.xz linux-ca078bae813dd46c0f9b102fdfb4a3384641ff48.zip |
[PATCH] swsusp: switch pm_message_t to struct
This adds type-checking to pm_message_t, so that people can't confuse it
with int or u32. It also allows us to fix "disk yoyo" during suspend (disk
spinning down/up/down).
[We've tried that before; since that cpufreq problems were fixed and I've
tried make allyes config and fixed resulting damage.]
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Alexander Nyberg <alexn@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/base/power/sysfs.c')
-rw-r--r-- | drivers/base/power/sysfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index f82b3df9545f..8d04fb435c17 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c @@ -26,19 +26,19 @@ static ssize_t state_show(struct device * dev, struct device_attribute *attr, char * buf) { - return sprintf(buf, "%u\n", dev->power.power_state); + return sprintf(buf, "%u\n", dev->power.power_state.event); } static ssize_t state_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t n) { - u32 state; + pm_message_t state; char * rest; int error = 0; - state = simple_strtoul(buf, &rest, 10); + state.event = simple_strtoul(buf, &rest, 10); if (*rest) return -EINVAL; - if (state) + if (state.event) error = dpm_runtime_suspend(dev, state); else dpm_runtime_resume(dev); |