mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
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>
This commit is contained in:
@ -174,8 +174,10 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||||||
* GPIO compatibility layer.
|
* GPIO compatibility layer.
|
||||||
*/
|
*/
|
||||||
ret = gpio_lookup_name(str_gpio, NULL, NULL, &gpio);
|
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);
|
return cmd_process_error(cmdtp, ret);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/* turn the gpio name into a gpio number */
|
/* turn the gpio name into a gpio number */
|
||||||
gpio = name_to_gpio(str_gpio);
|
gpio = name_to_gpio(str_gpio);
|
||||||
|
Reference in New Issue
Block a user