diff options
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r-- | drivers/usb/core/driver.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 34e3da5aa72a..e03042883c68 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -1046,8 +1046,7 @@ static int usb_resume_device(struct usb_device *udev, pm_message_t msg) | |||
1046 | /* Non-root devices on a full/low-speed bus must wait for their | 1046 | /* Non-root devices on a full/low-speed bus must wait for their |
1047 | * companion high-speed root hub, in case a handoff is needed. | 1047 | * companion high-speed root hub, in case a handoff is needed. |
1048 | */ | 1048 | */ |
1049 | if (!(msg.event & PM_EVENT_AUTO) && udev->parent && | 1049 | if (!PMSG_IS_AUTO(msg) && udev->parent && udev->bus->hs_companion) |
1050 | udev->bus->hs_companion) | ||
1051 | device_pm_wait_for_dev(&udev->dev, | 1050 | device_pm_wait_for_dev(&udev->dev, |
1052 | &udev->bus->hs_companion->root_hub->dev); | 1051 | &udev->bus->hs_companion->root_hub->dev); |
1053 | 1052 | ||
@@ -1075,7 +1074,7 @@ static int usb_suspend_interface(struct usb_device *udev, | |||
1075 | 1074 | ||
1076 | if (driver->suspend) { | 1075 | if (driver->suspend) { |
1077 | status = driver->suspend(intf, msg); | 1076 | status = driver->suspend(intf, msg); |
1078 | if (status && !(msg.event & PM_EVENT_AUTO)) | 1077 | if (status && !PMSG_IS_AUTO(msg)) |
1079 | dev_err(&intf->dev, "%s error %d\n", | 1078 | dev_err(&intf->dev, "%s error %d\n", |
1080 | "suspend", status); | 1079 | "suspend", status); |
1081 | } else { | 1080 | } else { |
@@ -1189,7 +1188,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1189 | status = usb_suspend_interface(udev, intf, msg); | 1188 | status = usb_suspend_interface(udev, intf, msg); |
1190 | 1189 | ||
1191 | /* Ignore errors during system sleep transitions */ | 1190 | /* Ignore errors during system sleep transitions */ |
1192 | if (!(msg.event & PM_EVENT_AUTO)) | 1191 | if (!PMSG_IS_AUTO(msg)) |
1193 | status = 0; | 1192 | status = 0; |
1194 | if (status != 0) | 1193 | if (status != 0) |
1195 | break; | 1194 | break; |
@@ -1199,7 +1198,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1199 | status = usb_suspend_device(udev, msg); | 1198 | status = usb_suspend_device(udev, msg); |
1200 | 1199 | ||
1201 | /* Again, ignore errors during system sleep transitions */ | 1200 | /* Again, ignore errors during system sleep transitions */ |
1202 | if (!(msg.event & PM_EVENT_AUTO)) | 1201 | if (!PMSG_IS_AUTO(msg)) |
1203 | status = 0; | 1202 | status = 0; |
1204 | } | 1203 | } |
1205 | 1204 | ||