diff options
-rw-r--r-- | drivers/usb/core/hub.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 6e6797d145dd..822f8c50e423 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -4725,7 +4725,8 @@ hub_power_remaining(struct usb_hub *hub) | |||
4725 | static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, | 4725 | static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, |
4726 | u16 portchange) | 4726 | u16 portchange) |
4727 | { | 4727 | { |
4728 | int status, i; | 4728 | int status = -ENODEV; |
4729 | int i; | ||
4729 | unsigned unit_load; | 4730 | unsigned unit_load; |
4730 | struct usb_device *hdev = hub->hdev; | 4731 | struct usb_device *hdev = hub->hdev; |
4731 | struct usb_hcd *hcd = bus_to_hcd(hdev->bus); | 4732 | struct usb_hcd *hcd = bus_to_hcd(hdev->bus); |
@@ -4929,9 +4930,10 @@ loop: | |||
4929 | 4930 | ||
4930 | done: | 4931 | done: |
4931 | hub_port_disable(hub, port1, 1); | 4932 | hub_port_disable(hub, port1, 1); |
4932 | if (hcd->driver->relinquish_port && !hub->hdev->parent) | 4933 | if (hcd->driver->relinquish_port && !hub->hdev->parent) { |
4933 | hcd->driver->relinquish_port(hcd, port1); | 4934 | if (status != -ENOTCONN && status != -ENODEV) |
4934 | 4935 | hcd->driver->relinquish_port(hcd, port1); | |
4936 | } | ||
4935 | } | 4937 | } |
4936 | 4938 | ||
4937 | /* Handle physical or logical connection change events. | 4939 | /* Handle physical or logical connection change events. |