Skip to content

Commit 0c21639

Browse files
MrVanbrgl
authored andcommitted
gpio: mvebu: use platform_irq_count
platform_irq_count() is the more generic way (independent of device trees) to determine the count of available interrupts. So use this instead. As platform_irq_count() might return an error code (which of_irq_count doesn't) some additional handling is necessary. Reviewed-by: Uwe Kleine-König <[email protected]> Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 725c1cb commit 0c21639

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpio/gpio-mvebu.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include <linux/irqdomain.h>
4747
#include <linux/mfd/syscon.h>
4848
#include <linux/of_device.h>
49-
#include <linux/of_irq.h>
5049
#include <linux/pinctrl/consumer.h>
5150
#include <linux/platform_device.h>
5251
#include <linux/pwm.h>
@@ -1102,7 +1101,11 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
11021101
soc_variant = MVEBU_GPIO_SOC_VARIANT_ORION;
11031102

11041103
/* Some gpio controllers do not provide irq support */
1105-
have_irqs = of_irq_count(np) != 0;
1104+
err = platform_irq_count(pdev);
1105+
if (err < 0)
1106+
return err;
1107+
1108+
have_irqs = err != 0;
11061109

11071110
mvchip = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_gpio_chip),
11081111
GFP_KERNEL);

0 commit comments

Comments
 (0)