9
0
Fork 0

usb: make usb devices children of the corresponding host

To be able to find usb devices in the hardware tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-09-22 14:41:24 +02:00
parent 78182d5d4f
commit eacd5e7cc3
4 changed files with 5 additions and 0 deletions

View File

@ -440,6 +440,8 @@ static 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;
register_device(&dev->dev);
/* now prode if the device is a hub */

View File

@ -883,6 +883,7 @@ int ehci_register(struct device_d *dev, struct ehci_data *data)
ehci->qh_list = dma_alloc_coherent(sizeof(struct QH) * NUM_TD);
ehci->td = dma_alloc_coherent(sizeof(struct qTD) * NUM_TD);
host->hw_dev = dev;
host->init = ehci_init;
host->submit_int_msg = submit_int_msg;
host->submit_control_msg = submit_control_msg;

View File

@ -1794,6 +1794,7 @@ static int ohci_probe(struct device_d *dev)
ohci = xzalloc(sizeof(struct ohci));
host = &ohci->host;
host->hw_dev = dev;
host->init = ohci_init;
host->submit_int_msg = submit_int_msg;
host->submit_control_msg = submit_control_msg;

View File

@ -210,6 +210,7 @@ struct usb_host {
struct list_head list;
struct device_d *hw_dev;
int busnum;
int scanned;
};