summaryrefslogtreecommitdiff
path: root/common/usb_storage.c
diff options
context:
space:
mode:
authorAras Vaichas <arasv@magtech.com.au>2008-03-25 12:09:07 +1100
committerMarkus Klotzbuecher <mk@denx.de>2008-03-26 09:23:23 +0100
commitf6b44e0e4d18fe507833a0f76d24a9aa72c123f1 (patch)
tree552473178f816413f99dc24f4b188f447c18464d /common/usb_storage.c
parent18e69a35efbb078403db0c0063986470dad7d082 (diff)
downloadu-boot-imx-f6b44e0e4d18fe507833a0f76d24a9aa72c123f1.zip
u-boot-imx-f6b44e0e4d18fe507833a0f76d24a9aa72c123f1.tar.gz
u-boot-imx-f6b44e0e4d18fe507833a0f76d24a9aa72c123f1.tar.bz2
USB Storage, add meaningful return value
This patch changes the "usb storage" command to return success if it finds a USB storage device, otherwise it returns error. Signed-off-by: Markus Klotzbuecher <mk@denx.de>
Diffstat (limited to 'common/usb_storage.c')
-rw-r--r--common/usb_storage.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 443d785..81d2f92 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -188,17 +188,20 @@ void usb_show_progress(void)
* show info on storage devices; 'usb start/init' must be invoked earlier
* as we only retrieve structures populated during devices initialization
*/
-void usb_stor_info(void)
+int usb_stor_info(void)
{
int i;
- if (usb_max_devs > 0)
+ if (usb_max_devs > 0) {
for (i = 0; i < usb_max_devs; i++) {
printf (" Device %d: ", i);
dev_print(&usb_dev_desc[i]);
+ return 0;
}
- else
+ } else {
printf("No storage devices, perhaps not 'usb start'ed..?\n");
+ return 1;
+ }
}
/*********************************************************************************