From 4569ddd9130ecb475b224ffbc6851e0b4c471028 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 28 Feb 2020 10:22:39 +0100 Subject: 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 --- drivers/usb/core/usb.c | 8 +++++--- 1 file 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; -- cgit v1.2.3