Browse Source

gpio: Correct handling of 'gpio status'

This is broken - we need to look at the first two characters to distinguish
'gpio status' from 'gpio set'.

Fixes: 0ffe6ab5 (gpio: Allow 's' as an abbreviation for 'status')
Reported-by: Soeren Moch <smoch@web.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Soeren Moch <smoch@web.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Simon Glass 8 years ago
parent
commit
4c80c53c00
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cmd/gpio.c

+ 1 - 1
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 (!strncmp(str_cmd, "status", 2)) {
 		/* Support deprecated gpio_status() */
 #ifdef gpio_status
 		gpio_status();