diff options
author | Jonas Gorski <jonas.gorski@gmail.com> | 2021-10-14 15:33:42 +0300 |
---|---|---|
committer | Bartosz Golaszewski <brgl@bgdev.pl> | 2021-10-25 11:10:37 +0300 |
commit | 85fe6415c146d5d42ce300c12f1ecf4d4af47d40 (patch) | |
tree | a7d08f69b07bd3accb7a0146db8a17025ae3b8f8 /drivers | |
parent | 6fda593f3082ef1aa783ac13e89f673fd69a2cb6 (diff) | |
download | linux-85fe6415c146d5d42ce300c12f1ecf4d4af47d40.tar.xz |
gpio: xgs-iproc: fix parsing of ngpios property
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@gmail.com>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpio-xgs-iproc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c index fa9b4d8c3ff5..43ca52fa6f9a 100644 --- a/drivers/gpio/gpio-xgs-iproc.c +++ b/drivers/gpio/gpio-xgs-iproc.c @@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) } 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); |