]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/core/hub.c
Merge branch 'next' (accumulated 3.16 merge window patches) into master
[karo-tx-linux.git] / drivers / usb / core / hub.c
index db6287025c06148adcd86608a0f7c38743be7a36..879b66e13370b5fc80fda8709d12dbbb2bd7d788 100644 (file)
@@ -1706,8 +1706,19 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
         */
        pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
 
-       /* Hubs have proper suspend/resume support. */
-       usb_enable_autosuspend(hdev);
+       /*
+        * Hubs have proper suspend/resume support, except for root hubs
+        * where the controller driver doesn't have bus_suspend and
+        * bus_resume methods.
+        */
+       if (hdev->parent) {             /* normal device */
+               usb_enable_autosuspend(hdev);
+       } else {                        /* root hub */
+               const struct hc_driver *drv = bus_to_hcd(hdev->bus)->driver;
+
+               if (drv->bus_suspend && drv->bus_resume)
+                       usb_enable_autosuspend(hdev);
+       }
 
        if (hdev->level == MAX_TOPO_LEVEL) {
                dev_err(&intf->dev,