Skip to content

Commit befbfe6

Browse files
prabhakarladMarc Zyngier
authored andcommitted
irqchip/renesas-irqc: Use platform_get_irq_optional() to get the interrupt
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 79a7f77 commit befbfe6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/irqchip/irq-renesas-irqc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ static int irqc_probe(struct platform_device *pdev)
126126
struct device *dev = &pdev->dev;
127127
const char *name = dev_name(dev);
128128
struct irqc_priv *p;
129-
struct resource *irq;
130129
int ret;
131130
int k;
132131

@@ -142,13 +141,15 @@ static int irqc_probe(struct platform_device *pdev)
142141

143142
/* allow any number of IRQs between 1 and IRQC_IRQ_MAX */
144143
for (k = 0; k < IRQC_IRQ_MAX; k++) {
145-
irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
146-
if (!irq)
144+
ret = platform_get_irq_optional(pdev, k);
145+
if (ret == -ENXIO)
147146
break;
147+
if (ret < 0)
148+
goto err_runtime_pm_disable;
148149

149150
p->irq[k].p = p;
150151
p->irq[k].hw_irq = k;
151-
p->irq[k].requested_irq = irq->start;
152+
p->irq[k].requested_irq = ret;
152153
}
153154

154155
p->number_of_irqs = k;

0 commit comments

Comments
 (0)