[U-Boot] [PATCH] cmd_usb.c: show cmd usage if no args given

Signed-off-by: Serge Ziryukin ftrvxmtrx@gmail.com --- common/cmd_usb.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/common/cmd_usb.c b/common/cmd_usb.c index ee3755c..fcb5f76 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -516,6 +516,11 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) block_dev_desc_t *stor_dev; #endif
+ if (argc < 2) { + cmd_usage(cmdtp); + return 1; + } + if ((strncmp(argv[1], "reset", 5) == 0) || (strncmp(argv[1], "start", 5) == 0)) { usb_stop();

Dear Serge Ziryukin,
In message 1272220356-1024-1-git-send-email-ftrvxmtrx@gmail.com you wrote:
Signed-off-by: Serge Ziryukin ftrvxmtrx@gmail.com
common/cmd_usb.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
Applied.
Note that the old code already printed a usage message when called without arguments, but only after USB had been started, so your code is indeed an improvement. Thanks.
Best regards,
Wolfgang Denk
participants (2)
-
Serge Ziryukin
-
Wolfgang Denk