aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-08-07 21:58:56 +0200
committerTom Rini <trini@konsulko.com>2022-11-23 13:06:12 -0500
commit18538112878bdf3da28143d59a11667e0e2e3a1c (patch)
treea7ed2152c71067dbb32350527efb75344de98067 /cmd
parent6b752c729e3ae22abbb2e854c87290115901b975 (diff)
downloadu-boot-18538112878bdf3da28143d59a11667e0e2e3a1c.zip
u-boot-18538112878bdf3da28143d59a11667e0e2e3a1c.tar.gz
u-boot-18538112878bdf3da28143d59a11667e0e2e3a1c.tar.bz2
cmd: ubifs: Do not show usage when command fails
Return value -1 cause U-Boot to print usage message. Return value 1 (CMD_RET_FAILURE) indicates failure. So fix return value when ubifs command starts it execution and fails. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Dhruva Gole <d-gole@ti.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ubifs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/ubifs.c b/cmd/ubifs.c
index 7a620c5..6a01d09 100644
--- a/cmd/ubifs.c
+++ b/cmd/ubifs.c
@@ -33,7 +33,7 @@ int cmd_ubifs_mount(char *vol_name)
ret = uboot_ubifs_mount(vol_name);
if (ret)
- return -1;
+ return CMD_RET_FAILURE;
ubifs_mounted = 1;
@@ -62,7 +62,7 @@ int cmd_ubifs_umount(void)
{
if (ubifs_initialized == 0) {
printf("No UBIFS volume mounted!\n");
- return -1;
+ return CMD_RET_FAILURE;
}
uboot_ubifs_umount();
@@ -89,7 +89,7 @@ static int do_ubifs_ls(struct cmd_tbl *cmdtp, int flag, int argc,
if (!ubifs_mounted) {
printf("UBIFS not mounted, use ubifsmount to mount volume first!\n");
- return -1;
+ return CMD_RET_FAILURE;
}
if (argc == 2)
@@ -116,7 +116,7 @@ static int do_ubifs_load(struct cmd_tbl *cmdtp, int flag, int argc,
if (!ubifs_mounted) {
printf("UBIFS not mounted, use ubifs mount to mount volume first!\n");
- return -1;
+ return CMD_RET_FAILURE;
}
if (argc < 3)