serial: ar933x: Use platform_get_irq() 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 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-9-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Lad Prabhakar 2021-12-24 14:29:14 +00:00 committed by Greg Kroah-Hartman
parent f63f1ddb5c
commit 1129a63e3a

View File

@ -707,11 +707,11 @@ static int ar933x_uart_probe(struct platform_device *pdev)
struct ar933x_uart_port *up; struct ar933x_uart_port *up;
struct uart_port *port; struct uart_port *port;
struct resource *mem_res; struct resource *mem_res;
struct resource *irq_res;
struct device_node *np; struct device_node *np;
unsigned int baud; unsigned int baud;
int id; int id;
int ret; int ret;
int irq;
np = pdev->dev.of_node; np = pdev->dev.of_node;
if (IS_ENABLED(CONFIG_OF) && np) { if (IS_ENABLED(CONFIG_OF) && np) {
@ -730,11 +730,9 @@ static int ar933x_uart_probe(struct platform_device *pdev)
if (id >= CONFIG_SERIAL_AR933X_NR_UARTS) if (id >= CONFIG_SERIAL_AR933X_NR_UARTS)
return -EINVAL; return -EINVAL;
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); irq = platform_get_irq(pdev, 0);
if (!irq_res) { if (irq < 0)
dev_err(&pdev->dev, "no IRQ resource\n"); return irq;
return -EINVAL;
}
up = devm_kzalloc(&pdev->dev, sizeof(struct ar933x_uart_port), up = devm_kzalloc(&pdev->dev, sizeof(struct ar933x_uart_port),
GFP_KERNEL); GFP_KERNEL);
@ -766,7 +764,7 @@ static int ar933x_uart_probe(struct platform_device *pdev)
port->mapbase = mem_res->start; port->mapbase = mem_res->start;
port->line = id; port->line = id;
port->irq = irq_res->start; port->irq = irq;
port->dev = &pdev->dev; port->dev = &pdev->dev;
port->type = PORT_AR933X; port->type = PORT_AR933X;
port->iotype = UPIO_MEM32; port->iotype = UPIO_MEM32;