git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
33965c7
)
cmd: spi: Judge the number of added parameters
author
chenzhipeng
<chenzhipeng@eswincomputing.com>
Tue, 6 Dec 2022 09:24:38 +0000
(17:24 +0800)
committer
Tom Rini
<trini@konsulko.com>
Thu, 12 Jan 2023 16:25:17 +0000
(11:25 -0500)
When only sspi is entered, help information can be printed.
Signed-off-by: chenzhipeng <chenzhipeng@eswincomputing.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/spi.c
patch
|
blob
|
history
diff --git
a/cmd/spi.c
b/cmd/spi.c
index
454ebe3
..
f30018f
100644
(file)
--- a/
cmd/spi.c
+++ b/
cmd/spi.c
@@
-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);