Skip to content

Commit

Permalink
gpio: xgs-iproc: fix parsing of ngpios property
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
KanjiMonster authored and brgl committed Oct 25, 2021
1 parent 6fda593 commit 85fe641
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-xgs-iproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 85fe641

Please sign in to comment.