summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-10 13:55:20 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-18 14:50:20 +0200
commit2b21f4c822c0e04618c4b46e295dbabbfe6e0602 (patch)
tree76606faf0fdb759990d626b580af607647817147
parent16e1d3899cfab2d1d5883372b0c5563dd5697b4b (diff)
downloadbarebox-2b21f4c822c0e04618c4b46e295dbabbfe6e0602.tar.gz
barebox-2b21f4c822c0e04618c4b46e295dbabbfe6e0602.tar.xz
USB: host: fixup USB device hierarchy
Make all USB devices children to the hub device they are attached to. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/core/hub.c1
-rw-r--r--drivers/usb/core/usb.c3
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 0f43955862..26c2ca05ab 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -196,6 +196,7 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port)
/* Allocate a new device struct for it */
usb = usb_alloc_new_device();
+ usb->dev.parent = &dev->dev;
usb->host = dev->host;
if (portstatus & USB_PORT_STAT_HIGH_SPEED)
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index c289bbbc7d..7c69e102ad 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -424,8 +424,6 @@ int usb_new_device(struct usb_device *dev)
dev->dev.id = DEVICE_ID_SINGLE;
- if (dev->host->hw_dev)
- dev->dev.parent = dev->host->hw_dev;
print_usb_device(dev);
err = register_device(&dev->dev);
@@ -500,6 +498,7 @@ int usb_host_detect(struct usb_host *host, int force)
return ret;
dev = usb_alloc_new_device();
+ dev->dev.parent = host->hw_dev;
dev->host = host;
usb_new_device(dev);