diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-04-28 11:06:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 15:15:50 -0700 |
commit | 6ee0b270c733027b2b716b1c80b9aced41e08d20 (patch) | |
tree | 8ad1db0a6bb5410a75381e98cf1ecfe390d6322d /drivers/usb/core/driver.c | |
parent | 9e5eace734a7b4e96a4ba4cf1f85622446e95e17 (diff) | |
download | op-kernel-dev-6ee0b270c733027b2b716b1c80b9aced41e08d20.zip op-kernel-dev-6ee0b270c733027b2b716b1c80b9aced41e08d20.tar.gz |
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.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index d0b37d7..bf1585b 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++) { |