Skip to content

Commit

Permalink
irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get t…
Browse files Browse the repository at this point in the history
…he 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 <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211216182121.5323-1-prabhakar.mahadev-lad.rj@bp.renesas.com
  • Loading branch information
Lad Prabhakar authored and Marc Zyngier committed Dec 20, 2021
1 parent befbfe6 commit 31bd548
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/irqchip/irq-renesas-intc-irqpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ static int intc_irqpin_probe(struct platform_device *pdev)
struct intc_irqpin_priv *p;
struct intc_irqpin_iomem *i;
struct resource *io[INTC_IRQPIN_REG_NR];
struct resource *irq;
struct irq_chip *irq_chip;
void (*enable_fn)(struct irq_data *d);
void (*disable_fn)(struct irq_data *d);
Expand Down Expand Up @@ -418,12 +417,14 @@ static int intc_irqpin_probe(struct platform_device *pdev)

/* allow any number of IRQs between 1 and INTC_IRQPIN_MAX */
for (k = 0; k < INTC_IRQPIN_MAX; k++) {
irq = platform_get_resource(pdev, IORESOURCE_IRQ, k);
if (!irq)
ret = platform_get_irq_optional(pdev, k);
if (ret == -ENXIO)
break;
if (ret < 0)
goto err0;

p->irq[k].p = p;
p->irq[k].requested_irq = irq->start;
p->irq[k].requested_irq = ret;
}

nirqs = k;
Expand Down

0 comments on commit 31bd548

Please sign in to comment.