summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-01-11 20:34:46 +0100
committerMarek Vasut <marex@denx.de>2015-01-18 12:31:36 +0100
commitd906bbc26219a0c10c34e595176d9376e134943b (patch)
tree15a555cad7a2f5c0adf969b505ae4254909d1711 /common
parent3cbcb2892809b59d59bf62cb8e49705227ee382a (diff)
downloadblackbird-obmc-uboot-d906bbc26219a0c10c34e595176d9376e134943b.tar.gz
blackbird-obmc-uboot-d906bbc26219a0c10c34e595176d9376e134943b.zip
usb: Do not log an error when no devices is plugged into a root-hub-less hcd
Before this commit u-boot would print the following on boot with musb and no usb device plugged in: starting USB... USB0: Port not available. USB error: all controllers failed lowlevel init This commit changes this to: starting USB... USB0: Port not available. Which is the correct thing to do since the low-level init went fine. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'common')
-rw-r--r--common/usb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/usb.c b/common/usb.c
index 736cd9f009..1eda0998d2 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -59,6 +59,7 @@ int usb_init(void)
void *ctrl;
struct usb_device *dev;
int i, start_index = 0;
+ int controllers_initialized = 0;
int ret;
dev_index = 0;
@@ -78,6 +79,7 @@ int usb_init(void)
ret = usb_lowlevel_init(i, USB_INIT_HOST, &ctrl);
if (ret == -ENODEV) { /* No such device. */
puts("Port not available.\n");
+ controllers_initialized++;
continue;
}
@@ -89,6 +91,7 @@ int usb_init(void)
* lowlevel init is OK, now scan the bus for devices
* i.e. search HUBs and configure them
*/
+ controllers_initialized++;
start_index = dev_index;
printf("scanning bus %d for devices... ", i);
dev = usb_alloc_new_device(ctrl);
@@ -110,12 +113,10 @@ int usb_init(void)
debug("scan end\n");
/* if we were not able to find at least one working bus, bail out */
- if (!usb_started) {
+ if (controllers_initialized == 0)
puts("USB error: all controllers failed lowlevel init\n");
- return -1;
- }
- return 0;
+ return usb_started ? 0 : -1;
}
/******************************************************************************
OpenPOWER on IntegriCloud