Commit befbfe6f authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Marc Zyngier
Browse files

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: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211216182121.5323-2-prabhakar.mahadev-lad.rj@bp.renesas.com
parent 79a7f77b
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -126,7 +126,6 @@ static int irqc_probe(struct platform_device *pdev)
	struct device *dev = &pdev->dev;
	struct device *dev = &pdev->dev;
	const char *name = dev_name(dev);
	const char *name = dev_name(dev);
	struct irqc_priv *p;
	struct irqc_priv *p;
	struct resource *irq;
	int ret;
	int ret;
	int k;
	int k;


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


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


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


	p->number_of_irqs = k;
	p->number_of_irqs = k;