From: Simon Glass Date: Sun, 14 Feb 2016 23:28:59 +0000 (-0700) Subject: gpio: Correct handling of 'gpio status' X-Git-Tag: v2016.03-rc2~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4c80c53c00ac6583f22938fc98e4df688acdf4ce;p=u-boot 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 Signed-off-by: Simon Glass Tested-by: Soeren Moch Reviewed-by: Bin Meng Tested-by: Hannes Schmelzer --- diff --git a/cmd/gpio.c b/cmd/gpio.c index 2b78b16866..693998e8bd 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 (!strncmp(str_cmd, "status", 2)) { /* Support deprecated gpio_status() */ #ifdef gpio_status gpio_status();