summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/cmd_usb.c3
-rw-r--r--common/usb_storage.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index c6b17c2..ad32407 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -529,8 +529,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
if (strncmp(argv[1], "stor", 4) == 0) {
- usb_stor_info();
- return 0;
+ return usb_stor_info();
}
if (strncmp(argv[1],"part",4) == 0) {
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;
+ }
}
/*********************************************************************************