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 <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-2-prabhakar.mahadev-lad.rj@bp.renesas.com
1 parent 79a7f77 commit befbfe6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

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)