summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
authorAlan Stern2008-04-28 17:06:42 +0200
committerGreg Kroah-Hartman2008-07-22 00:15:50 +0200
commit6ee0b270c733027b2b716b1c80b9aced41e08d20 (patch)
tree8ad1db0a6bb5410a75381e98cf1ecfe390d6322d /drivers/usb/core/driver.c
parentUSB: revert "don't use reset-resume if drivers don't support it" (diff)
downloadkernel-qcow2-linux-6ee0b270c733027b2b716b1c80b9aced41e08d20.tar.gz
kernel-qcow2-linux-6ee0b270c733027b2b716b1c80b9aced41e08d20.tar.xz
kernel-qcow2-linux-6ee0b270c733027b2b716b1c80b9aced41e08d20.zip
USB: simplify hub_restart() logic
This patch (as1081) straightens out the logic of the hub_restart() routine. Each port of the hub is scanned and the driver makes sure that ports which are supposed to be disabled really _are_ disabled. Any ports with a significant change in status are flagged in hub->change_bits, so that khubd can focus on them without the need to scan all the ports a second time -- which means the hub->activating flag is no longer needed. Also, it is now recognized explicitly that the only reason for resuming a port which was not suspended is to carry out a reset-resume operation, which happens only in a non-CONFIG_USB_SUSPEND setting. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r--drivers/usb/core/driver.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index d0b37d776afe..bf1585b203ca 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -805,8 +805,6 @@ static int usb_resume_device(struct usb_device *udev)
if (udev->state == USB_STATE_NOTATTACHED)
goto done;
- if (udev->state != USB_STATE_SUSPENDED && !udev->reset_resume)
- goto done;
/* Can't resume it if it doesn't have a driver. */
if (udev->dev.driver == NULL) {
@@ -1173,11 +1171,8 @@ static int usb_resume_both(struct usb_device *udev)
* then we're stuck. */
status = usb_resume_device(udev);
}
- } else {
-
- /* Needed for reset-resume */
+ } else if (udev->reset_resume)
status = usb_resume_device(udev);
- }
if (status == 0 && udev->actconfig) {
for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {