]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/core/hub.c
Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[karo-tx-linux.git] / drivers / usb / core / hub.c
index d6cc83249341e862aea7e2892677408df55f8626..96f05b29c9ad23ba6c0874a29dc2066c16806476 100644 (file)
@@ -2369,8 +2369,6 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
        int             port1 = udev->portnum;
        int             status;
 
-       // dev_dbg(hub->intfdev, "suspend port %d\n", port1);
-
        /* enable remote wakeup when appropriate; this lets the device
         * wake up the upstream hub (including maybe the root hub).
         *
@@ -2387,7 +2385,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
                        dev_dbg(&udev->dev, "won't remote wakeup, status %d\n",
                                        status);
                        /* bail if autosuspend is requested */
-                       if (msg.event & PM_EVENT_AUTO)
+                       if (PMSG_IS_AUTO(msg))
                                return status;
                }
        }
@@ -2416,12 +2414,13 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
                                USB_CTRL_SET_TIMEOUT);
 
                /* System sleep transitions should never fail */
-               if (!(msg.event & PM_EVENT_AUTO))
+               if (!PMSG_IS_AUTO(msg))
                        status = 0;
        } else {
                /* device has up to 10 msec to fully suspend */
-               dev_dbg(&udev->dev, "usb %ssuspend\n",
-                               (msg.event & PM_EVENT_AUTO ? "auto-" : ""));
+               dev_dbg(&udev->dev, "usb %ssuspend, wakeup %d\n",
+                               (PMSG_IS_AUTO(msg) ? "auto-" : ""),
+                               udev->do_remote_wakeup);
                usb_set_device_state(udev, USB_STATE_SUSPENDED);
                msleep(10);
        }
@@ -2572,7 +2571,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
        } else {
                /* drive resume for at least 20 msec */
                dev_dbg(&udev->dev, "usb %sresume\n",
-                               (msg.event & PM_EVENT_AUTO ? "auto-" : ""));
+                               (PMSG_IS_AUTO(msg) ? "auto-" : ""));
                msleep(25);
 
                /* Virtual root hubs can trigger on GET_PORT_STATUS to
@@ -2679,7 +2678,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
                udev = hdev->children [port1-1];
                if (udev && udev->can_submit) {
                        dev_warn(&intf->dev, "port %d nyet suspended\n", port1);
-                       if (msg.event & PM_EVENT_AUTO)
+                       if (PMSG_IS_AUTO(msg))
                                return -EBUSY;
                }
        }