From f6b44e0e4d18fe507833a0f76d24a9aa72c123f1 Mon Sep 17 00:00:00 2001 From: Aras Vaichas Date: Tue, 25 Mar 2008 12:09:07 +1100 Subject: 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 --- common/usb_storage.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'common/usb_storage.c') diff --git a/common/usb_storage.c b/common/usb_storage.c index 443d78574ab..81d2f92100e 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; + } } /********************************************************************************* -- cgit v1.2.3