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/usb/core | |
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/usb/core')
-rw-r--r-- | drivers/usb/core/hub.c | 18 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index c3e46d24a37e..c9412daff682 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1570,7 +1570,7 @@ static int __usb_suspend_device (struct usb_device *udev, int port1, | |||
1570 | struct usb_driver *driver; | 1570 | struct usb_driver *driver; |
1571 | 1571 | ||
1572 | intf = udev->actconfig->interface[i]; | 1572 | intf = udev->actconfig->interface[i]; |
1573 | if (state <= intf->dev.power.power_state) | 1573 | if (state.event <= intf->dev.power.power_state.event) |
1574 | continue; | 1574 | continue; |
1575 | if (!intf->dev.driver) | 1575 | if (!intf->dev.driver) |
1576 | continue; | 1576 | continue; |
@@ -1578,11 +1578,11 @@ static int __usb_suspend_device (struct usb_device *udev, int port1, | |||
1578 | 1578 | ||
1579 | if (driver->suspend) { | 1579 | if (driver->suspend) { |
1580 | status = driver->suspend(intf, state); | 1580 | status = driver->suspend(intf, state); |
1581 | if (intf->dev.power.power_state != state | 1581 | if (intf->dev.power.power_state.event != state.event |
1582 | || status) | 1582 | || status) |
1583 | dev_err(&intf->dev, | 1583 | dev_err(&intf->dev, |
1584 | "suspend %d fail, code %d\n", | 1584 | "suspend %d fail, code %d\n", |
1585 | state, status); | 1585 | state.event, status); |
1586 | } | 1586 | } |
1587 | 1587 | ||
1588 | /* only drivers with suspend() can ever resume(); | 1588 | /* only drivers with suspend() can ever resume(); |
@@ -1595,7 +1595,7 @@ static int __usb_suspend_device (struct usb_device *udev, int port1, | |||
1595 | * since we know every driver's probe/disconnect works | 1595 | * since we know every driver's probe/disconnect works |
1596 | * even for drivers that can't suspend. | 1596 | * even for drivers that can't suspend. |
1597 | */ | 1597 | */ |
1598 | if (!driver->suspend || state > PM_SUSPEND_MEM) { | 1598 | if (!driver->suspend || state.event > PM_EVENT_FREEZE) { |
1599 | #if 1 | 1599 | #if 1 |
1600 | dev_warn(&intf->dev, "resume is unsafe!\n"); | 1600 | dev_warn(&intf->dev, "resume is unsafe!\n"); |
1601 | #else | 1601 | #else |
@@ -1616,7 +1616,7 @@ static int __usb_suspend_device (struct usb_device *udev, int port1, | |||
1616 | * policies (when HNP doesn't apply) once we have mechanisms to | 1616 | * policies (when HNP doesn't apply) once we have mechanisms to |
1617 | * turn power back on! (Likely not before 2.7...) | 1617 | * turn power back on! (Likely not before 2.7...) |
1618 | */ | 1618 | */ |
1619 | if (state > PM_SUSPEND_MEM) { | 1619 | if (state.event > PM_EVENT_FREEZE) { |
1620 | dev_warn(&udev->dev, "no poweroff yet, suspending instead\n"); | 1620 | dev_warn(&udev->dev, "no poweroff yet, suspending instead\n"); |
1621 | } | 1621 | } |
1622 | 1622 | ||
@@ -1733,7 +1733,7 @@ static int finish_port_resume(struct usb_device *udev) | |||
1733 | struct usb_driver *driver; | 1733 | struct usb_driver *driver; |
1734 | 1734 | ||
1735 | intf = udev->actconfig->interface[i]; | 1735 | intf = udev->actconfig->interface[i]; |
1736 | if (intf->dev.power.power_state == PMSG_ON) | 1736 | if (intf->dev.power.power_state.event == PM_EVENT_ON) |
1737 | continue; | 1737 | continue; |
1738 | if (!intf->dev.driver) { | 1738 | if (!intf->dev.driver) { |
1739 | /* FIXME maybe force to alt 0 */ | 1739 | /* FIXME maybe force to alt 0 */ |
@@ -1747,11 +1747,11 @@ static int finish_port_resume(struct usb_device *udev) | |||
1747 | 1747 | ||
1748 | /* can we do better than just logging errors? */ | 1748 | /* can we do better than just logging errors? */ |
1749 | status = driver->resume(intf); | 1749 | status = driver->resume(intf); |
1750 | if (intf->dev.power.power_state != PMSG_ON | 1750 | if (intf->dev.power.power_state.event != PM_EVENT_ON |
1751 | || status) | 1751 | || status) |
1752 | dev_dbg(&intf->dev, | 1752 | dev_dbg(&intf->dev, |
1753 | "resume fail, state %d code %d\n", | 1753 | "resume fail, state %d code %d\n", |
1754 | intf->dev.power.power_state, status); | 1754 | intf->dev.power.power_state.event, status); |
1755 | } | 1755 | } |
1756 | status = 0; | 1756 | status = 0; |
1757 | 1757 | ||
@@ -1934,7 +1934,7 @@ static int hub_resume(struct usb_interface *intf) | |||
1934 | unsigned port1; | 1934 | unsigned port1; |
1935 | int status; | 1935 | int status; |
1936 | 1936 | ||
1937 | if (intf->dev.power.power_state == PM_SUSPEND_ON) | 1937 | if (intf->dev.power.power_state.event == PM_EVENT_ON) |
1938 | return 0; | 1938 | return 0; |
1939 | 1939 | ||
1940 | for (port1 = 1; port1 <= hdev->maxchild; port1++) { | 1940 | for (port1 = 1; port1 <= hdev->maxchild; port1++) { |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 99c85d2f92da..2cddd8a00437 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -1400,7 +1400,7 @@ static int usb_generic_suspend(struct device *dev, pm_message_t message) | |||
1400 | driver = to_usb_driver(dev->driver); | 1400 | driver = to_usb_driver(dev->driver); |
1401 | 1401 | ||
1402 | /* there's only one USB suspend state */ | 1402 | /* there's only one USB suspend state */ |
1403 | if (intf->dev.power.power_state) | 1403 | if (intf->dev.power.power_state.event) |
1404 | return 0; | 1404 | return 0; |
1405 | 1405 | ||
1406 | if (driver->suspend) | 1406 | if (driver->suspend) |