diff mbox

[U-Boot,v2,02/37] gpio: Warn about invalid GPIOs used with the 'gpio' command

Message ID 1453430725-4641-3-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Jan. 22, 2016, 2:44 a.m. UTC
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>
---

Changes in v2: None

 common/cmd_gpio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Simon Glass Jan. 22, 2016, 6:37 p.m. UTC | #1
On 21 January 2016 at 19:44, Simon Glass <sjg@chromium.org> wrote:
> 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>
> ---
>
> Changes in v2: None
>
>  common/cmd_gpio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied to u-boot-rockchip.
diff mbox

Patch

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);