summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.c
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 /drivers/usb/core/usb.c
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>
Diffstat (limited to 'drivers/usb/core/usb.c')
-rw-r--r--drivers/usb/core/usb.c3
1 files changed, 1 insertions, 2 deletions
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);