[U-Boot] [PATCH v2 10/34] gpio: Use case-insentive matching on the GPIO name

Simon Glass sjg at chromium.org
Sun Feb 17 03:24:43 UTC 2019


Allow the 'gpio' command to match GPIO bank names regardless of the case
of each. While these are generally in upper case, it is useful to be able
to provide lower case with the command.

Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
---

Changes in v2: None

 cmd/gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/gpio.c b/cmd/gpio.c
index 539e07ee077..53366f36e76 100644
--- a/cmd/gpio.c
+++ b/cmd/gpio.c
@@ -90,7 +90,7 @@ static int do_gpio_status(bool all, const char *gpio_name)
 		banklen = bank_name ? strlen(bank_name) : 0;
 
 		if (!gpio_name || !bank_name ||
-		    !strncmp(gpio_name, bank_name, banklen)) {
+		    !strncasecmp(gpio_name, bank_name, banklen)) {
 			const char *p = NULL;
 			int offset;
 
-- 
2.21.0.rc0.258.g878e2cd30e-goog



More information about the U-Boot mailing list