summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-06-24 10:16:26 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-06-24 11:41:36 +0200
commitd99aa6b7613fe670eff2930ebc6f79d667947530 (patch)
tree646d97434b164b030a37e499d4c061080c7bf5e9 /drivers
parentc8363b8f603db301575cf444108554e5485e24a5 (diff)
downloadbarebox-d99aa6b7613fe670eff2930ebc6f79d667947530.tar.gz
barebox-d99aa6b7613fe670eff2930ebc6f79d667947530.tar.xz
usb: Check return value of host controller init
And do not scan the bus if initialization failed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/usb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/usb.c b/drivers/usb/usb.c
index 1ad4babb88..76e033eb7b 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;