diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-07-10 15:17:50 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-07-18 14:50:21 +0200 |
commit | c7d3ec47f9699bb210799593ebb277168259b8c5 (patch) | |
tree | 61928cf9e69991c441d5559334dedf56a7dea1d5 /drivers | |
parent | 9d5b3cbe511ec68c92b38307603490ef303ec4f8 (diff) | |
download | barebox-c7d3ec47f9699bb210799593ebb277168259b8c5.tar.gz barebox-c7d3ec47f9699bb210799593ebb277168259b8c5.tar.xz |
USB: host: hub: only configure hub once
We had a single function which configures the hub and scans
the ports. Split this up and configure the hub only once and
scan the ports during detect() time. This allows to plug in
additional devices into a hub while continuing to use the
already existing devices.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/hub.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 689a79c774..39cadb55ff 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -405,6 +405,13 @@ static int usb_hub_configure(struct usb_device *dev) "" : "no "); usb_hub_power_on(hub); + return 0; +} + +static int usb_hub_configure_ports(struct usb_device *dev) +{ + int i; + for (i = 0; i < dev->maxchild; i++) usb_hub_configure_port(dev, i); @@ -416,7 +423,7 @@ static int usb_hub_detect(struct device_d *dev) struct usb_device *usbdev = container_of(dev, struct usb_device, dev); int i; - usb_hub_configure(usbdev); + usb_hub_configure_ports(usbdev); for (i = 0; i < usbdev->maxchild; i++) { if (usbdev->children[i]) |