diff options
author | Pavel Machek <pavel@ucw.cz> | 2005-09-03 18:56:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:06:16 -0400 |
commit | ca078bae813dd46c0f9b102fdfb4a3384641ff48 (patch) | |
tree | e3348f5dcb24159a522941aa2e3ee40bc9e0589b /drivers/base/power/runtime.c | |
parent | 829ca9a30a2ddb727981d80fabdbff2ea86bc9ea (diff) |
[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/runtime.c')
-rw-r--r-- | drivers/base/power/runtime.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 325962d80191..e8f0519f5dfa 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c | |||
@@ -13,10 +13,10 @@ | |||
13 | static void runtime_resume(struct device * dev) | 13 | static void runtime_resume(struct device * dev) |
14 | { | 14 | { |
15 | dev_dbg(dev, "resuming\n"); | 15 | dev_dbg(dev, "resuming\n"); |
16 | if (!dev->power.power_state) | 16 | if (!dev->power.power_state.event) |
17 | return; | 17 | return; |
18 | if (!resume_device(dev)) | 18 | if (!resume_device(dev)) |
19 | dev->power.power_state = 0; | 19 | dev->power.power_state = PMSG_ON; |
20 | } | 20 | } |
21 | 21 | ||
22 | 22 | ||
@@ -49,10 +49,10 @@ int dpm_runtime_suspend(struct device * dev, pm_message_t state) | |||
49 | int error = 0; | 49 | int error = 0; |
50 | 50 | ||
51 | down(&dpm_sem); | 51 | down(&dpm_sem); |
52 | if (dev->power.power_state == state) | 52 | if (dev->power.power_state.event == state.event) |
53 | goto Done; | 53 | goto Done; |
54 | 54 | ||
55 | if (dev->power.power_state) | 55 | if (dev->power.power_state.event) |
56 | runtime_resume(dev); | 56 | runtime_resume(dev); |
57 | 57 | ||
58 | if (!(error = suspend_device(dev, state))) | 58 | if (!(error = suspend_device(dev, state))) |