gpio: Warn about invalid GPIOs used with the 'gpio' command
authorSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 02:44:50 +0000 (19:44 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 03:42:36 +0000 (20:42 -0700)
At present there is no indication that an invalid GPIO is used except that
the GPIO status is not displayed. Make the error more explicit to avoid
confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/cmd_gpio.c

index bb0f63a592477f6f2288d14f5b12283764f790bb..2b78b168663e05dde9e70d0a15696db11079c4ac 100644 (file)
@@ -174,8 +174,10 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         * GPIO compatibility layer.
         */
        ret = gpio_lookup_name(str_gpio, NULL, NULL, &gpio);
-       if (ret)
+       if (ret) {
+               printf("GPIO: '%s' not found\n", str_gpio);
                return cmd_process_error(cmdtp, ret);
+       }
 #else
        /* turn the gpio name into a gpio number */
        gpio = name_to_gpio(str_gpio);