[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>
This commit is contained in:

committed by
Linus Torvalds

parent
829ca9a30a
commit
ca078bae81
@@ -13,10 +13,10 @@
|
||||
static void runtime_resume(struct device * dev)
|
||||
{
|
||||
dev_dbg(dev, "resuming\n");
|
||||
if (!dev->power.power_state)
|
||||
if (!dev->power.power_state.event)
|
||||
return;
|
||||
if (!resume_device(dev))
|
||||
dev->power.power_state = 0;
|
||||
dev->power.power_state = PMSG_ON;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,10 +49,10 @@ int dpm_runtime_suspend(struct device * dev, pm_message_t state)
|
||||
int error = 0;
|
||||
|
||||
down(&dpm_sem);
|
||||
if (dev->power.power_state == state)
|
||||
if (dev->power.power_state.event == state.event)
|
||||
goto Done;
|
||||
|
||||
if (dev->power.power_state)
|
||||
if (dev->power.power_state.event)
|
||||
runtime_resume(dev);
|
||||
|
||||
if (!(error = suspend_device(dev, state)))
|
||||
|
Reference in New Issue
Block a user