[PATCH 3/6] usb: Check return value of host controller init

Sascha Hauer s.hauer at pengutronix.de
Thu Jun 24 05:45:48 EDT 2010


And do not scan the bus if initialization failed.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/usb/usb.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/usb.c b/drivers/usb/usb.c
index 1ad4bab..76e033e 100644
--- a/drivers/usb/usb.c
+++ b/drivers/usb/usb.c
@@ -453,6 +453,7 @@ static int __usb_init(void)
 {
 	struct usb_device *dev, *tmp;
 	struct usb_host *host;
+	int ret;
 
 	list_for_each_entry_safe(dev, tmp, &usb_device_list, list) {
 		list_del(&dev->list);
@@ -466,7 +467,9 @@ static int __usb_init(void)
 	dev_index = 0;
 
 	list_for_each_entry(host, &host_list, list) {
-		host->init(host);
+		ret = host->init(host);
+		if (ret)
+			continue;
 
 		dev = usb_alloc_new_device();
 		dev->host = host;
-- 
1.7.1




More information about the barebox mailing list