summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/usb.c')
-rw-r--r--drivers/usb/core/usb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index ea244d4bcf..938a28e030 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -88,11 +88,25 @@ static inline void usb_host_release(struct usb_host *host)
slice_release(&host->slice);
}
+static int usb_hw_detect(struct device_d *dev)
+{
+ struct usb_host *host;
+
+ list_for_each_entry(host, &host_list, list) {
+ if (dev == host->hw_dev)
+ return usb_host_detect(host);
+ }
+
+ return -ENODEV;
+}
+
int usb_register_host(struct usb_host *host)
{
list_add_tail(&host->list, &host_list);
host->busnum = host_busnum++;
slice_init(&host->slice, dev_name(host->hw_dev));
+ if (!host->hw_dev->detect)
+ host->hw_dev->detect = usb_hw_detect;
return 0;
}