summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-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);