Skip to content
Snippets Groups Projects
Commit 4fbd258e authored by Simon Glass's avatar Simon Glass
Browse files

i2c: Correct command return values


We should not return a -ve error code from command functions. Instead,
return CMD_RET_FAILURE. This avoids the "exit not allowed from main input
shell" error messages from the hush shell.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Acked-by: default avatarHeiko Schocher <hs@denx.de>
parent 4a1db6d8
No related branches found
No related tags found
No related merge requests found
...@@ -1809,7 +1809,8 @@ static int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc, ...@@ -1809,7 +1809,8 @@ static int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc,
if (ret) if (ret)
printf("Failure changing bus number (%d)\n", ret); printf("Failure changing bus number (%d)\n", ret);
} }
return ret;
return ret ? CMD_RET_FAILURE : 0;
} }
#endif /* defined(CONFIG_SYS_I2C) */ #endif /* defined(CONFIG_SYS_I2C) */
...@@ -1852,7 +1853,8 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const ...@@ -1852,7 +1853,8 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const
if (ret) if (ret)
printf("Failure changing bus speed (%d)\n", ret); printf("Failure changing bus speed (%d)\n", ret);
} }
return ret;
return ret ? CMD_RET_FAILURE : 0;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment