Skip to content

Commit 31bd548

Browse files
prabhakarladMarc Zyngier
authored andcommitted
irqchip/renesas-intc-irqpin: 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 befbfe6 commit 31bd548

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/irqchip/irq-renesas-intc-irqpin.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ static int intc_irqpin_probe(struct platform_device *pdev)
375375
struct intc_irqpin_priv *p;
376376
struct intc_irqpin_iomem *i;
377377
struct resource *io[INTC_IRQPIN_REG_NR];
378-
struct resource *irq;
379378
struct irq_chip *irq_chip;
380379
void (*enable_fn)(struct irq_data *d);
381380
void (*disable_fn)(struct irq_data *d);
@@ -418,12 +417,14 @@ static int intc_irqpin_probe(struct platform_device *pdev)
418417

419418
/* allow any number of IRQs between 1 and INTC_IRQPIN_MAX */
420419
for (k = 0; k < INTC_IRQPIN_MAX; k++) {
421-
irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
422-
if (!irq)
420+
ret = platform_get_irq_optional(pdev, k);
421+
if (ret == -ENXIO)
423422
break;
423+
if (ret < 0)
424+
goto err0;
424425

425426
p->irq[k].p = p;
426-
p->irq[k].requested_irq = irq->start;
427+
p->irq[k].requested_irq = ret;
427428
}
428429

429430
nirqs = k;

0 commit comments

Comments
 (0)