summaryrefslogtreecommitdiff
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-05-04 11:55:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 16:29:47 -0700
commitdd4dd19e8d13e1e9bf8295bf71f132b511b130bf (patch)
treed2202761f84ab4d04ca21c28d7dbefd689e2acc2 /drivers/usb/core/hub.c
parent3c519b846c4d5edf7c94d1eede42445a815bf65c (diff)
USB: Make device reset stop retrying after disconnect
This patch (as898) changes the port reset code in the hub driver. If a connect change occurs, it is reported the same way as a disconnect (which of course is what it really is). It also changes usb_reset_device(), to prevent the routine from futilely retrying the reset after a disconnect has occurred. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index d37ad083d5ef..f4ef7c25096e 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1539,9 +1539,9 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
if (!(portstatus & USB_PORT_STAT_CONNECTION))
return -ENOTCONN;
- /* bomb out completely if something weird happened */
+ /* bomb out completely if the connection bounced */
if ((portchange & USB_PORT_STAT_C_CONNECTION))
- return -EINVAL;
+ return -ENOTCONN;
/* if we`ve finished resetting, then break out of the loop */
if (!(portstatus & USB_PORT_STAT_RESET) &&
@@ -2974,7 +2974,7 @@ int usb_reset_device(struct usb_device *udev)
* Other endpoints will be handled by re-enumeration. */
ep0_reinit(udev);
ret = hub_port_init(parent_hub, udev, port1, i);
- if (ret >= 0)
+ if (ret >= 0 || ret == -ENOTCONN || ret == -ENODEV)
break;
}
clear_bit(port1, parent_hub->busy_bits);