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/suspend.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/suspend.c')
-rw-r--r-- | drivers/base/power/suspend.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index 2ccee3763acf..50501764d050 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c | |||
@@ -40,22 +40,22 @@ int suspend_device(struct device * dev, pm_message_t state) | |||
40 | int error = 0; | 40 | int error = 0; |
41 | 41 | ||
42 | down(&dev->sem); | 42 | down(&dev->sem); |
43 | if (dev->power.power_state) { | 43 | if (dev->power.power_state.event) { |
44 | dev_dbg(dev, "PM: suspend %d-->%d\n", | 44 | dev_dbg(dev, "PM: suspend %d-->%d\n", |
45 | dev->power.power_state, state); | 45 | dev->power.power_state.event, state.event); |
46 | } | 46 | } |
47 | if (dev->power.pm_parent | 47 | if (dev->power.pm_parent |
48 | && dev->power.pm_parent->power.power_state) { | 48 | && dev->power.pm_parent->power.power_state.event) { |
49 | dev_err(dev, | 49 | dev_err(dev, |
50 | "PM: suspend %d->%d, parent %s already %d\n", | 50 | "PM: suspend %d->%d, parent %s already %d\n", |
51 | dev->power.power_state, state, | 51 | dev->power.power_state.event, state.event, |
52 | dev->power.pm_parent->bus_id, | 52 | dev->power.pm_parent->bus_id, |
53 | dev->power.pm_parent->power.power_state); | 53 | dev->power.pm_parent->power.power_state.event); |
54 | } | 54 | } |
55 | 55 | ||
56 | dev->power.prev_state = dev->power.power_state; | 56 | dev->power.prev_state = dev->power.power_state; |
57 | 57 | ||
58 | if (dev->bus && dev->bus->suspend && !dev->power.power_state) { | 58 | if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) { |
59 | dev_dbg(dev, "suspending\n"); | 59 | dev_dbg(dev, "suspending\n"); |
60 | error = dev->bus->suspend(dev, state); | 60 | error = dev->bus->suspend(dev, state); |
61 | } | 61 | } |