aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index a428aa080a36..13bc83240adb 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2324,8 +2324,6 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
2324 int port1 = udev->portnum; 2324 int port1 = udev->portnum;
2325 int status; 2325 int status;
2326 2326
2327 // dev_dbg(hub->intfdev, "suspend port %d\n", port1);
2328
2329 /* enable remote wakeup when appropriate; this lets the device 2327 /* enable remote wakeup when appropriate; this lets the device
2330 * wake up the upstream hub (including maybe the root hub). 2328 * wake up the upstream hub (including maybe the root hub).
2331 * 2329 *
@@ -2342,7 +2340,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
2342 dev_dbg(&udev->dev, "won't remote wakeup, status %d\n", 2340 dev_dbg(&udev->dev, "won't remote wakeup, status %d\n",
2343 status); 2341 status);
2344 /* bail if autosuspend is requested */ 2342 /* bail if autosuspend is requested */
2345 if (msg.event & PM_EVENT_AUTO) 2343 if (PMSG_IS_AUTO(msg))
2346 return status; 2344 return status;
2347 } 2345 }
2348 } 2346 }
@@ -2367,12 +2365,13 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
2367 USB_CTRL_SET_TIMEOUT); 2365 USB_CTRL_SET_TIMEOUT);
2368 2366
2369 /* System sleep transitions should never fail */ 2367 /* System sleep transitions should never fail */
2370 if (!(msg.event & PM_EVENT_AUTO)) 2368 if (!PMSG_IS_AUTO(msg))
2371 status = 0; 2369 status = 0;
2372 } else { 2370 } else {
2373 /* device has up to 10 msec to fully suspend */ 2371 /* device has up to 10 msec to fully suspend */
2374 dev_dbg(&udev->dev, "usb %ssuspend\n", 2372 dev_dbg(&udev->dev, "usb %ssuspend, wakeup %d\n",
2375 (msg.event & PM_EVENT_AUTO ? "auto-" : "")); 2373 (PMSG_IS_AUTO(msg) ? "auto-" : ""),
2374 udev->do_remote_wakeup);
2376 usb_set_device_state(udev, USB_STATE_SUSPENDED); 2375 usb_set_device_state(udev, USB_STATE_SUSPENDED);
2377 msleep(10); 2376 msleep(10);
2378 } 2377 }
@@ -2523,7 +2522,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
2523 } else { 2522 } else {
2524 /* drive resume for at least 20 msec */ 2523 /* drive resume for at least 20 msec */
2525 dev_dbg(&udev->dev, "usb %sresume\n", 2524 dev_dbg(&udev->dev, "usb %sresume\n",
2526 (msg.event & PM_EVENT_AUTO ? "auto-" : "")); 2525 (PMSG_IS_AUTO(msg) ? "auto-" : ""));
2527 msleep(25); 2526 msleep(25);
2528 2527
2529 /* Virtual root hubs can trigger on GET_PORT_STATUS to 2528 /* Virtual root hubs can trigger on GET_PORT_STATUS to
@@ -2625,7 +2624,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
2625 udev = hdev->children [port1-1]; 2624 udev = hdev->children [port1-1];
2626 if (udev && udev->can_submit) { 2625 if (udev && udev->can_submit) {
2627 dev_warn(&intf->dev, "port %d nyet suspended\n", port1); 2626 dev_warn(&intf->dev, "port %d nyet suspended\n", port1);
2628 if (msg.event & PM_EVENT_AUTO) 2627 if (PMSG_IS_AUTO(msg))
2629 return -EBUSY; 2628 return -EBUSY;
2630 } 2629 }
2631 } 2630 }