[U-Boot] [PATCH] gpio: Correct handling of 'gpio status'

Soeren Moch smoch at web.de
Mon Feb 15 08:36:26 CET 2016


On 15.02.2016 00:28, Simon Glass wrote:
> 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 at web.de>
> Signed-off-by: Simon Glass <sjg at chromium.org>

Tested-by: Soeren Moch <smoch at web.de>

With this patch 'gpio set' works again.

Thanks,
Soeren

> ---
> 
>  cmd/gpio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cmd/gpio.c b/cmd/gpio.c
> index 2b78b16..693998e 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();
> 


More information about the U-Boot mailing list