From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jH5Bj-000543-EJ for barebox@lists.infradead.org; Wed, 25 Mar 2020 12:31:17 +0000 From: Sascha Hauer Date: Wed, 25 Mar 2020 13:30:58 +0100 Message-Id: <20200325123111.9612-12-s.hauer@pengutronix.de> In-Reply-To: <20200325123111.9612-1-s.hauer@pengutronix.de> References: <20200325123111.9612-1-s.hauer@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 11/24] usb: host: make init hook optional To: Barebox List 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; -- 2.26.0.rc2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox