[U-Boot] [PATCH v2] cmd_mmc: use common usage function
Mike Frysinger
vapier at gentoo.org
Thu Jul 29 19:40:43 CEST 2010
Rather than using a custom "Usage:", use the common cmd_usage() function,
and tail into it now that it returns 1 for us.
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
v2
- tail into cmd_usage() as pointed out by Detlev Zundel
common/cmd_mmc.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index e5f5e94..5ee73ab 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -156,8 +156,7 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
case 0:
case 1:
case 4:
- printf("Usage:\n%s\n", cmdtp->usage);
- return 1;
+ return cmd_usage(cmdtp);
case 2:
if (!strcmp(argv[1], "list")) {
@@ -212,10 +211,8 @@ int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("%d blocks written: %s\n",
n, (n == cnt) ? "OK" : "ERROR");
return (n == cnt) ? 0 : 1;
- } else {
- printf("Usage:\n%s\n", cmdtp->usage);
- rc = 1;
- }
+ } else
+ rc = cmd_usage(cmdtp);
return rc;
}
--
1.7.2
More information about the U-Boot
mailing list