cmd: spi: Judge the number of added parameters
PATCH 1/1 cmd: spi: Judge the number of added parameters
When only sspi is entered, help information can be printed.
Signed-off-by chenzhipeng <[email protected]>
--- cmd/spi.c | 3 +++ 1 file changed, 3 insertions(+)
cmd/spi.c +3 -0
@@ -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);
Signature · 1 line
2.25.1
Quoted 8 lines · chenzhipeng
When only sspi is entered, help information can be printed.
Signed-off-by chenzhipeng <[email protected]>--- cmd/spi.c | 3 +++ 1 file changed, 3 insertions(+)
Reviewed-by Simon Glass <[email protected]>
Quoted 17 lines
cmd/spi.c +3
-1@@ -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); --2.25.1
Quoted 4 lines · chenzhipeng
When only sspi is entered, help information can be printed.
Signed-off-by chenzhipeng <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom