As we support both Host and Device mode operation, an OTG controller
can return -ENODEV on a port which it found to be in Device mode during
Host mode scan for devices. In case -ENODEV is returned, print that the
port is not available and continue instead of screaming a bloody error
message.
Signed-off-by: Marek Vasut <marex@denx.de>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <compiler.h>
-
+#include <errno.h>
#include <usb.h>
#ifdef CONFIG_4xx
#include <asm/4xx_pci.h>
void *ctrl;
struct usb_device *dev;
int i, start_index = 0;
+ int ret;
dev_index = 0;
asynch_allowed = 1;
for (i = 0; i < CONFIG_USB_MAX_CONTROLLER_COUNT; i++) {
/* init low_level USB */
printf("USB%d: ", i);
- if (usb_lowlevel_init(i, USB_INIT_HOST, &ctrl)) {
+ ret = usb_lowlevel_init(i, USB_INIT_HOST, &ctrl);
+ if (ret == -ENODEV) { /* No such device. */
+ puts("Port not available.\n");
+ continue;
+ }
+
+ if (ret) { /* Other error. */
puts("lowlevel init failed\n");
continue;
}