]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
gpio: Use case-insentive matching on the GPIO name
authorSimon Glass <sjg@chromium.org>
Sun, 17 Feb 2019 03:24:43 +0000 (20:24 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Wed, 20 Feb 2019 07:25:28 +0000 (15:25 +0800)
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@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
cmd/gpio.c

index 539e07ee077ed0100815354b9aa6a06197909307..53366f36e768d0f1b60c072837532a07515e6850 100644 (file)
@@ -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;