summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-05-10 14:10:19 +0200
committerSimon Glass <sjg@chromium.org>2015-05-14 18:49:31 -0600
commita24a0e91590bb7452ddf531b9ae0e93216bd1237 (patch)
tree8f953bfd448936f732a030ce40e1cf5e8a49d494 /drivers
parent8a5f0665da6701f06443ae989e9c0962807a1249 (diff)
downloadu-boot-imx-a24a0e91590bb7452ddf531b9ae0e93216bd1237.zip
u-boot-imx-a24a0e91590bb7452ddf531b9ae0e93216bd1237.tar.gz
u-boot-imx-a24a0e91590bb7452ddf531b9ae0e93216bd1237.tar.bz2
dm: usb: Move printing of usb scan status to usb_scan_bus()
Move printing of usb scan status to usb_scan_bus(). This is a preparation patch for adding companion controller support to the usb uclass. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/usb-uclass.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 9ee25ed..ad778b4 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -147,7 +147,7 @@ int usb_stop(void)
return err;
}
-static int usb_scan_bus(struct udevice *bus, bool recurse)
+static void usb_scan_bus(struct udevice *bus, bool recurse)
{
struct usb_bus_priv *priv;
struct udevice *dev;
@@ -157,11 +157,15 @@ static int usb_scan_bus(struct udevice *bus, bool recurse)
assert(recurse); /* TODO: Support non-recusive */
+ printf("scanning bus %d for devices... ", bus->seq);
+ debug("\n");
ret = usb_scan_device(bus, 0, USB_SPEED_FULL, &dev);
if (ret)
- return ret;
-
- return priv->next_addr;
+ printf("failed, error %d\n", ret);
+ else if (priv->next_addr == 0)
+ printf("No USB Device found\n");
+ else
+ printf("%d USB Device(s) found\n", priv->next_addr);
}
int usb_init(void)
@@ -199,15 +203,7 @@ int usb_init(void)
* i.e. search HUBs and configure them
*/
controllers_initialized++;
- printf("scanning bus %d for devices... ", bus->seq);
- debug("\n");
- ret = usb_scan_bus(bus, true);
- if (ret < 0)
- printf("failed, error %d\n", ret);
- else if (!ret)
- printf("No USB Device found\n");
- else
- printf("%d USB Device(s) found\n", ret);
+ usb_scan_bus(bus, true);
usb_started = true;
}