serial: pxa: Use platform_get_irq() to get the interrupt
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Fri, 24 Dec 2021 14:29:11 +0000 (14:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Dec 2021 12:26:49 +0000 (13:26 +0100)
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 bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20211224142917.6966-6-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/pxa.c

index 41319ef96fa6945e4d465a4d7000808c29ef1db5..30b099746a75456441a1753b90a14e0f355f6612 100644 (file)
@@ -842,14 +842,18 @@ static int serial_pxa_probe_dt(struct platform_device *pdev,
 static int serial_pxa_probe(struct platform_device *dev)
 {
        struct uart_pxa_port *sport;
-       struct resource *mmres, *irqres;
+       struct resource *mmres;
        int ret;
+       int irq;
 
        mmres = platform_get_resource(dev, IORESOURCE_MEM, 0);
-       irqres = platform_get_resource(dev, IORESOURCE_IRQ, 0);
-       if (!mmres || !irqres)
+       if (!mmres)
                return -ENODEV;
 
+       irq = platform_get_irq(dev, 0);
+       if (irq < 0)
+               return irq;
+
        sport = kzalloc(sizeof(struct uart_pxa_port), GFP_KERNEL);
        if (!sport)
                return -ENOMEM;
@@ -869,7 +873,7 @@ static int serial_pxa_probe(struct platform_device *dev)
        sport->port.type = PORT_PXA;
        sport->port.iotype = UPIO_MEM;
        sport->port.mapbase = mmres->start;
-       sport->port.irq = irqres->start;
+       sport->port.irq = irq;
        sport->port.fifosize = 64;
        sport->port.ops = &serial_pxa_pops;
        sport->port.dev = &dev->dev;