Skip to content

Commit 85fe641

Browse files
KanjiMonsterbrgl
authored andcommitted
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: 6a41b6c ("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>
1 parent 6fda593 commit 85fe641

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpio/gpio-xgs-iproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
224224
}
225225

226226
chip->gc.label = dev_name(dev);
227-
if (of_property_read_u32(dn, "ngpios", &num_gpios))
227+
if (!of_property_read_u32(dn, "ngpios", &num_gpios))
228228
chip->gc.ngpio = num_gpios;
229229

230230
irq = platform_get_irq(pdev, 0);

0 commit comments

Comments
 (0)