[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211101082548.797499643@linuxfoundation.org>
Date: Mon, 1 Nov 2021 10:17:35 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Jonas Gorski <jonas.gorski@...il.com>,
Chris Packham <chris.packham@...iedtelesis.co.nz>,
Florian Fainelli <f.fainelli@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>
Subject: [PATCH 5.14 082/125] gpio: xgs-iproc: fix parsing of ngpios property
From: Jonas Gorski <jonas.gorski@...il.com>
commit 85fe6415c146d5d42ce300c12f1ecf4d4af47d40 upstream.
of_property_read_u32 returns 0 on success, not true, so we need to
invert the check to actually take over the provided ngpio value.
Fixes: 6a41b6c5fc20 ("gpio: Add xgs-iproc driver")
Signed-off-by: Jonas Gorski <jonas.gorski@...il.com>
Reviewed-by: Chris Packham <chris.packham@...iedtelesis.co.nz>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Signed-off-by: Bartosz Golaszewski <brgl@...ev.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/gpio/gpio-xgs-iproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpio/gpio-xgs-iproc.c
+++ b/drivers/gpio/gpio-xgs-iproc.c
@@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platf
}
chip->gc.label = dev_name(dev);
- if (of_property_read_u32(dn, "ngpios", &num_gpios))
+ if (!of_property_read_u32(dn, "ngpios", &num_gpios))
chip->gc.ngpio = num_gpios;
irq = platform_get_irq(pdev, 0);
Powered by blists - more mailing lists