|
@@ -1461,6 +1461,7 @@ static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
|
|
|
int usb_suspend(struct device *dev, pm_message_t msg)
|
|
|
{
|
|
|
struct usb_device *udev = to_usb_device(dev);
|
|
|
+ int r;
|
|
|
|
|
|
unbind_no_pm_drivers_interfaces(udev);
|
|
|
|
|
@@ -1469,7 +1470,14 @@ int usb_suspend(struct device *dev, pm_message_t msg)
|
|
|
* so we may still need to unbind and rebind upon resume
|
|
|
*/
|
|
|
choose_wakeup(udev, msg);
|
|
|
- return usb_suspend_both(udev, msg);
|
|
|
+ r = usb_suspend_both(udev, msg);
|
|
|
+ if (r)
|
|
|
+ return r;
|
|
|
+
|
|
|
+ if (udev->quirks & USB_QUIRK_DISCONNECT_SUSPEND)
|
|
|
+ usb_port_disable(udev);
|
|
|
+
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
/* The device lock is held by the PM core */
|