Skip to contentSkip to conversation

cmd_fuse: return CMD_RET_FAILURE on error

PATCH New Hector Palacios 3 participants 3 messages Nov 20, 2014 – Dec 8, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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."

---

Changes for v2:
Reword commit message.

 common/cmd_fuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/cmd_fuse.c +1 -1
index abab9789b0df..d4bc0f6c94a1 100644
@@ -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(
#1 lore raw

PATCH v2 1/1 cmd_fuse: return CMD_RET_FAILURE on error

Dear Hector Palacios,

Quoted 20 lines · Hector Palacios

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."

---

Changes for v2:
Reword commit message.

 common/cmd_fuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/cmd_fuse.c +0 -0
index abab9789b0df..d4bc0f6c94a1 100644

common/cmd_fuse.c static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) · line 134

Quoted 8 lines
common/cmd_fuse.c +1 -1
@@ -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.

Best regards,
Beno?t

#2 lore raw

PATCH v2 1/1 cmd_fuse: return CMD_RET_FAILURE on error

In reply to Hector Palacios
Quoted 8 lines · Hector Palacios

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."

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141208/5d7cd50e/attachment.pgp>