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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 32b19135a5..06087d2df6 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -511,9 +511,11 @@ int usb_host_detect(struct usb_host *host)
int ret;
if (!host->root_dev) {
- ret = host->init(host);
- if (ret)
- return ret;
+ if (host->init) {
+ ret = host->init(host);
+ if (ret)
+ return ret;
+ }
host->root_dev = usb_alloc_new_device();
host->root_dev->dev.parent = host->hw_dev;