[U-Boot] [PATCH] Revert "gpio: Allow 's' as an abbreviation for 'status'"

Masahiro Yamada yamada.masahiro at socionext.com
Mon Feb 15 08:10:24 CET 2016


This reverts commit 0ffe6ab521f900bcc765be8f2f31d2c2ba3f0a7e.

The GPIO command has five sub-commands: status, input, set, clear,
and toggle.  Commit 0ffe6ab521f9 (" gpio: Allow 's' as an
abbreviation for 'status'") made the "set" sub-command unreachable
because the sub-command that starts with the letter "s" is regarded
as the "status" command.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

 cmd/gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/gpio.c b/cmd/gpio.c
index 2b78b16..7e02daf 100644
--- a/cmd/gpio.c
+++ b/cmd/gpio.c
@@ -141,7 +141,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
 	if (argc > 0)
 		str_gpio = *argv;
-	if (!strncmp(str_cmd, "status", 1)) {
+	if (!strcmp(str_cmd, "status")) {
 		/* Support deprecated gpio_status() */
 #ifdef gpio_status
 		gpio_status();
-- 
1.9.1



More information about the U-Boot mailing list