mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
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: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
4a1db6d8ab
commit
4fbd258e69
1 changed files with 4 additions and 2 deletions
|
@ -1809,7 +1809,8 @@ static int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc,
|
|||
if (ret)
|
||||
printf("Failure changing bus number (%d)\n", ret);
|
||||
}
|
||||
return ret;
|
||||
|
||||
return ret ? CMD_RET_FAILURE : 0;
|
||||
}
|
||||
#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
|
|||
if (ret)
|
||||
printf("Failure changing bus speed (%d)\n", ret);
|
||||
}
|
||||
return ret;
|
||||
|
||||
return ret ? CMD_RET_FAILURE : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue