diff options
author | Bryan Wu <bryan.wu@analog.com> | 2009-01-19 04:04:27 (GMT) |
---|---|---|
committer | Remy Bohmer <linux@bohmer.net> | 2009-01-28 18:57:31 (GMT) |
commit | 1a448db77b10153703bc5e4ad13dd55d88beb1d6 (patch) | |
tree | 6bc5d9ff55800b66de1a36005dc5f6a03d2f3601 | |
parent | f1c1f540243438246aefb703fdcf16957e3a72e1 (diff) | |
download | u-boot-fsl-qoriq-1a448db77b10153703bc5e4ad13dd55d88beb1d6.tar.xz |
usb_scan_devices: fix output with no devices
We should check the return of usb_new_device() so that if no USB device is
found, we print out the right message rather than always saying "new usb
device found".
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Remy Bohmer <linux@bohmer.net>
-rw-r--r-- | common/usb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/usb.c b/common/usb.c index 5f46831..87fca70 100644 --- a/common/usb.c +++ b/common/usb.c @@ -939,8 +939,10 @@ void usb_scan_devices(void) dev_index = 0; /* device 0 is always present (root hub, so let it analyze) */ dev = usb_alloc_new_device(); - usb_new_device(dev); - printf("%d USB Device(s) found\n", dev_index); + if (usb_new_device(dev)) + printf("No USB Device found\n"); + else + printf("%d USB Device(s) found\n", dev_index); /* insert "driver" if possible */ #ifdef CONFIG_USB_KEYBOARD drv_usb_kbd_init(); |