[U-Boot] [PATCH v2] cmd_fuse: return CMD_RET_FAILURE on error

Fuse drivers, like the mxs_ocotp.c, may return negative error codes but the commands are only allowed to return CMD_RET_* enum values to the shell, otherwise the following error appears:
"exit not allowed from main input shell."
Signed-off-by: Hector Palacios hector.palacios@digi.com ---
Changes for v2: Reword commit message.
common/cmd_fuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/cmd_fuse.c b/common/cmd_fuse.c index abab9789b0df..d4bc0f6c94a1 100644 --- a/common/cmd_fuse.c +++ b/common/cmd_fuse.c @@ -128,7 +128,7 @@ static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
err: puts("ERROR\n"); - return ret; + return CMD_RET_FAILURE; }
U_BOOT_CMD(

Dear Hector Palacios,
On Thu, Nov 20, 2014 at 9:27 AM, Hector Palacios hector.palacios@digi.com wrote:
Fuse drivers, like the mxs_ocotp.c, may return negative error codes but the commands are only allowed to return CMD_RET_* enum values to the shell, otherwise the following error appears:
"exit not allowed from main input shell."
Signed-off-by: Hector Palacios hector.palacios@digi.com
Changes for v2: Reword commit message.
common/cmd_fuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/cmd_fuse.c b/common/cmd_fuse.c index abab9789b0df..d4bc0f6c94a1 100644 --- a/common/cmd_fuse.c +++ b/common/cmd_fuse.c @@ -128,7 +128,7 @@ static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
err: puts("ERROR\n");
return ret;
return CMD_RET_FAILURE;
}
U_BOOT_CMD(
Thanks.
Reviewed-by: Benoît Thébaudeau benoit.thebaudeau.dev@gmail.com
Best regards, Benoît

On Thu, Nov 20, 2014 at 09:27:42AM +0100, Hector Palacios wrote:
Fuse drivers, like the mxs_ocotp.c, may return negative error codes but the commands are only allowed to return CMD_RET_* enum values to the shell, otherwise the following error appears:
"exit not allowed from main input shell."
Signed-off-by: Hector Palacios hector.palacios@digi.com Reviewed-by: Benoît Thébaudeau benoit.thebaudeau.dev@gmail.com
Applied to u-boot/master, thanks!
participants (3)
-
Benoît Thébaudeau
-
Hector Palacios
-
Tom Rini