diff options
author | chenzhipeng <chenzhipeng@eswincomputing.com> | 2022-12-06 12:24:38 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-12 19:25:17 +0300 |
commit | c40e021b83d9db9aec736a0cb992fd84d2e63c02 (patch) | |
tree | 42527e6e185c9a447d631035636d6ab5d0ceefd0 /cmd | |
parent | 33965c7e18a44b1b15c83921393a9cfc123f0e90 (diff) | |
download | u-boot-c40e021b83d9db9aec736a0cb992fd84d2e63c02.tar.xz |
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>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/spi.c | 3 |
1 files changed, 3 insertions, 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); |