Jerry Van Baren wrote:
> Wolfgang Denk wrote:
>> Dear Aras,
>>
>> in message <[EMAIL PROTECTED]> you wrote:
>>> This patch changes the "usb storage" command to return success iff it
>>> finds a USB storage device, otherwise it returns error.
>>
>> Thanks. I appreciate your contribution, but please fix the coding
>> style:
Done.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
--- a/include/usb.h 2008-03-19 13:47:18.000000000 +1100
+++ b/include/usb.h 2008-03-19 13:47:35.000000000 +1100
@@ -195,7 +195,7 @@
#define USB_MAX_STOR_DEV 5
block_dev_desc_t *usb_stor_get_dev(int index);
int usb_stor_scan(int mode);
-void usb_stor_info(void);
+int usb_stor_info(void);
#endif
--- a/common/cmd_usb.c 2008-03-19 13:39:37.000000000 +1100
+++ b/common/cmd_usb.c 2008-03-19 13:42:16.000000000 +1100
@@ -529,8 +529,7 @@
}
if (strncmp(argv[1], "stor", 4) == 0) {
- usb_stor_info();
- return 0;
+ return usb_stor_info();
}
if (strncmp(argv[1],"part",4) == 0) {
--- a/common/usb_storage.c 2008-03-19 13:32:02.000000000 +1100
+++ b/common/usb_storage.c 2008-03-25 11:48:41.000000000 +1100
@@ -188,17 +188,20 @@
* 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;
+ }
}
/*********************************************************************************
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users