diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-08-24 19:27:57 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-08-24 19:27:57 +0800 |
commit | 2d24df0e84490d49a5211468e8793ecf9ad8a5bb (patch) | |
tree | f6ad5cf51e4369f66f221cea59bdbb575d060480 /drivers/usb/core/hub.c | |
parent | 21b5f5d91a589931a22009d918fd319f481e8eee (diff) | |
parent | 425fdd287e9b41a20bc8b47a00064da3fcd8cae4 (diff) |
Merge tag 'v4.4.83' into linux-linaro-lsk-v4.4lsk-v4.4-17.08
This is the 4.4.83 stable release
Diffstat (limited to 'drivers/usb/core/hub.c')
-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 1d59d489a1ad..cdf4be3939f5 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4661,7 +4661,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); @@ -4865,9 +4866,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. |