summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-02-28 10:22:39 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-03-20 10:07:16 +0100
commit4569ddd9130ecb475b224ffbc6851e0b4c471028 (patch)
tree45bfb9df8cd5a7603eb0079b11bb8f698f8d72cd
parent891b0a02566c477e4b48cece3fbdae1fd3029a5c (diff)
downloadbarebox-4569ddd9130ecb475b224ffbc6851e0b4c471028.tar.gz
usb: host: make init hook optional
For controllers which do everything relevant during probe time make the init hook optional. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-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 32b1913..06087d2 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;