cmd: spi: Judge the number of added parameters
When only sspi is entered, help information can be printed. Signed-off-by: chenzhipeng <chenzhipeng@eswincomputing.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
33965c7e18
commit
c40e021b83
1 changed files with 3 additions and 0 deletions
|
@ -112,6 +112,9 @@ int do_spi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
|||
|
||||
if ((flag & CMD_FLAG_REPEAT) == 0)
|
||||
{
|
||||
if (argc < 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (argc >= 2) {
|
||||
mode = CONFIG_DEFAULT_SPI_MODE;
|
||||
bus = dectoul(argv[1], &cp);
|
||||
|
|
Loading…
Reference in a new issue