--- linux/drivers/usb/hub.c-orig	Tue May  1 09:55:11 2001
+++ linux/drivers/usb/hub.c	Tue May  1 14:56:53 2001
@@ -498,6 +498,7 @@
 #define HUB_LONG_RESET_TIME	200
 #define HUB_RESET_TIMEOUT	500
 
+/* return: -1 on error, 0 on success, 1 on disconnect.  */
 static int usb_hub_port_wait_reset(struct usb_device *hub, int port,
 				struct usb_device *dev, unsigned int delay)
 {
@@ -521,9 +522,12 @@
 		dbg("port %d, portstatus %x, change %x, %s", port + 1,
 			portstatus, portchange, portspeed (portstatus));
 
+		/* Device went away? */
+		if (!(portstatus & USB_PORT_STAT_CONNECTION))
+			return 1;
+
 		/* bomb out completely if something weird happened */
-		if ((portchange & USB_PORT_STAT_C_CONNECTION) ||
-		    !(portstatus & USB_PORT_STAT_CONNECTION))
+		if ((portchange & USB_PORT_STAT_C_CONNECTION))
 			return -1;
 
 		/* if we`ve finished resetting, then break out of the loop */
@@ -549,19 +553,21 @@
 	return -1;
 }
 
+/* return: -1 on error, 0 on success, 1 on disconnect.  */
 static int usb_hub_port_reset(struct usb_device *hub, int port,
 				struct usb_device *dev, unsigned int delay)
 {
-	int i;
+	int i, status;
 
 	/* Reset the port */
 	for (i = 0; i < HUB_RESET_TRIES; i++) {
 		usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET);
 
-		/* return success if the port reset OK */
-		if (!usb_hub_port_wait_reset(hub, port, dev, delay)) {
+		/* return on disconnect or reset */
+		status = usb_hub_port_wait_reset(hub, port, dev, delay);
+		if (status != -1) {
 			usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET);
-			return 0;
+			return status;
 		}
 
 		dbg("port %d of hub %d not enabled, trying reset again...",
