Skip to content
Snippets Groups Projects
Commit 66280e82 authored by Simon Glass's avatar Simon Glass
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
parent 35a1f0df
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment