summaryrefslogtreecommitdiff
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-07-08 15:58:56 -0700
committerJohn Stultz <john.stultz@linaro.org>2011-07-08 15:58:56 -0700
commita448bfbd8e15bb2ed380a75f20adeb6e8d752abb (patch)
tree1ab81f3867a5f7e0e9a6cc06fac678d670c2d464 /drivers/usb/core/driver.c
parent2aced4d6099ce987233ab2ffad42b90800dadf09 (diff)
parent0226f8a76da6bc97c9bb4af3fd2f6eeb03c5b0b0 (diff)
Merge branch 'upstream/android-3.0' into linaro-android-3.0
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r--drivers/usb/core/driver.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index aa3cc465a60..34e3da5aa72 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1187,13 +1187,22 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
for (i = n - 1; i >= 0; --i) {
intf = udev->actconfig->interface[i];
status = usb_suspend_interface(udev, intf, msg);
+
+ /* Ignore errors during system sleep transitions */
+ if (!(msg.event & PM_EVENT_AUTO))
+ status = 0;
if (status != 0)
break;
}
}
- if (status == 0)
+ if (status == 0) {
status = usb_suspend_device(udev, msg);
+ /* Again, ignore errors during system sleep transitions */
+ if (!(msg.event & PM_EVENT_AUTO))
+ status = 0;
+ }
+
/* If the suspend failed, resume interfaces that did get suspended */
if (status != 0) {
msg.event ^= (PM_EVENT_SUSPEND | PM_EVENT_RESUME);