|
@@ -4725,7 +4725,8 @@ hub_power_remaining(struct usb_hub *hub)
|
|
|
static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
|
|
|
u16 portchange)
|
|
|
{
|
|
|
- int status, i;
|
|
|
+ int status = -ENODEV;
|
|
|
+ int i;
|
|
|
unsigned unit_load;
|
|
|
struct usb_device *hdev = hub->hdev;
|
|
|
struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
|
|
@@ -4929,9 +4930,10 @@ loop:
|
|
|
|
|
|
done:
|
|
|
hub_port_disable(hub, port1, 1);
|
|
|
- if (hcd->driver->relinquish_port && !hub->hdev->parent)
|
|
|
- hcd->driver->relinquish_port(hcd, port1);
|
|
|
-
|
|
|
+ if (hcd->driver->relinquish_port && !hub->hdev->parent) {
|
|
|
+ if (status != -ENOTCONN && status != -ENODEV)
|
|
|
+ hcd->driver->relinquish_port(hcd, port1);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/* Handle physical or logical connection change events.
|