summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-01-21 19:44:50 -0700
committerSimon Glass <sjg@chromium.org>2016-01-21 20:42:36 -0700
commit66280e82f7fe90194236da39ab0e2f42869a8070 (patch)
tree252bf0e956a483d99da8bcc5a1b489004cfba306
parent35a1f0dfa13510b29f9d320a999819eb2d9cb857 (diff)
downloadu-boot-imx-66280e82f7fe90194236da39ab0e2f42869a8070.zip
u-boot-imx-66280e82f7fe90194236da39ab0e2f42869a8070.tar.gz
u-boot-imx-66280e82f7fe90194236da39ab0e2f42869a8070.tar.bz2
gpio: Warn about invalid GPIOs used with the 'gpio' command
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>
-rw-r--r--common/cmd_gpio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/cmd_gpio.c b/common/cmd_gpio.c
index bb0f63a..2b78b16 100644
--- a/common/cmd_gpio.c
+++ b/common/cmd_gpio.c
@@ -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);