summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/generic.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-08-30 15:47:18 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 11:58:57 -0700
commit01d883d44a1ca8dc77486635d428cba63e7fdadf (patch)
tree447a4293b2ec4dfa1b3d03a46a3a33498809f0e8 /drivers/usb/core/generic.c
parent645daaab0b6adc35c1838df2a82f9d729fdb1767 (diff)
downloadtalos-op-linux-01d883d44a1ca8dc77486635d428cba63e7fdadf.tar.gz
talos-op-linux-01d883d44a1ca8dc77486635d428cba63e7fdadf.zip
usbcore: non-hub-specific uses of autosuspend
This patch (as741) makes the non-hub parts of usbcore actually use the autosuspend facilities added by an earlier patch. Devices opened through usbfs are autoresumed and then autosuspended upon close. Likewise for usb-skeleton. Devices are autoresumed for usb_set_configuration. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/generic.c')
-rw-r--r--drivers/usb/core/generic.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index 5358e656477c..16332cc57946 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -172,14 +172,10 @@ static void generic_disconnect(struct usb_device *udev)
/* if this is only an unbind, not a physical disconnect, then
* unconfigure the device */
- if (udev->state == USB_STATE_CONFIGURED)
+ if (udev->actconfig)
usb_set_configuration(udev, 0);
usb_remove_sysfs_dev_files(udev);
-
- /* in case the call failed or the device was suspended */
- if (udev->state >= USB_STATE_CONFIGURED)
- usb_disable_device(udev, 0);
}
#ifdef CONFIG_PM
@@ -208,4 +204,5 @@ struct usb_device_driver usb_generic_driver = {
.suspend = generic_suspend,
.resume = generic_resume,
#endif
+ .supports_autosuspend = 1,
};
OpenPOWER on IntegriCloud