Skip to content

Commit 06e26b7

Browse files
MrVanlinusw
authored andcommitted
pinctrl: mvebu: armada-37xx: use use platform api
platform_irq_count() and platform_get_irq() 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. Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 72780ce commit 06e26b7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/pinctrl/mvebu/pinctrl-armada-37xx.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/of.h>
1616
#include <linux/of_address.h>
1717
#include <linux/of_device.h>
18-
#include <linux/of_irq.h>
1918
#include <linux/pinctrl/pinconf-generic.h>
2019
#include <linux/pinctrl/pinconf.h>
2120
#include <linux/pinctrl/pinctrl.h>
@@ -739,7 +738,14 @@ static int armada_37xx_irqchip_register(struct platform_device *pdev,
739738
return ret;
740739
}
741740

742-
nr_irq_parent = of_irq_count(np);
741+
nr_irq_parent = platform_irq_count(pdev);
742+
if (nr_irq_parent < 0) {
743+
if (nr_irq_parent != -EPROBE_DEFER)
744+
dev_err(dev, "Couldn't determine irq count: %pe\n",
745+
ERR_PTR(nr_irq_parent));
746+
return nr_irq_parent;
747+
}
748+
743749
spin_lock_init(&info->irq_lock);
744750

745751
if (!nr_irq_parent) {
@@ -776,7 +782,7 @@ static int armada_37xx_irqchip_register(struct platform_device *pdev,
776782
if (!girq->parents)
777783
return -ENOMEM;
778784
for (i = 0; i < nr_irq_parent; i++) {
779-
int irq = irq_of_parse_and_map(np, i);
785+
int irq = platform_get_irq(pdev, i);
780786

781787
if (irq < 0)
782788
continue;

0 commit comments

Comments
 (0)