UPSTREAM: usb: Make USB persist default configurable
[cascardo/linux.git] / drivers / usb / core / quirks.c
index 4c65eb6..99e61e9 100644 (file)
@@ -179,18 +179,12 @@ void usb_detect_quirks(struct usb_device *udev)
                dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
                                udev->quirks);
 
-       /* For the present, all devices default to USB-PERSIST enabled */
-#if 0          /* was: #ifdef CONFIG_PM */
-       /* Hubs are automatically enabled for USB-PERSIST */
-       if (udev->descriptor.bDeviceClass == USB_CLASS_HUB)
+#ifdef CONFIG_USB_DEFAULT_PERSIST
+       if (!(udev->quirks & USB_QUIRK_RESET_MORPHS))
                udev->persist_enabled = 1;
-
 #else
-       /* In the absence of PM, we can safely enable USB-PERSIST
-        * for all devices.  It will affect things like hub resets
-        * and EMF-related port disables.
-        */
-       if (!(udev->quirks & USB_QUIRK_RESET_MORPHS))
+       /* Hubs are automatically enabled for USB-PERSIST */
+       if (udev->descriptor.bDeviceClass == USB_CLASS_HUB)
                udev->persist_enabled = 1;
-#endif /* CONFIG_PM */
+#endif /* CONFIG_USB_DEFAULT_PERSIST */
 }