Skip to content

Commit 35be435

Browse files
KanjiMonsterksacilotto
authored andcommitted
gpio: xgs-iproc: fix parsing of ngpios property
BugLink: https://bugs.launchpad.net/bugs/1952785 commit 85fe641 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: 6a41b6c ("gpio: Add xgs-iproc driver") Signed-off-by: Jonas Gorski <[email protected]> Reviewed-by: Chris Packham <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 901d76b commit 35be435

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)