Skip to content

Commit 1129a63

Browse files
prabhakarladgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f63f1dd commit 1129a63

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/tty/serial/ar933x_uart.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -707,11 +707,11 @@ static int ar933x_uart_probe(struct platform_device *pdev)
707707
struct ar933x_uart_port *up;
708708
struct uart_port *port;
709709
struct resource *mem_res;
710-
struct resource *irq_res;
711710
struct device_node *np;
712711
unsigned int baud;
713712
int id;
714713
int ret;
714+
int irq;
715715

716716
np = pdev->dev.of_node;
717717
if (IS_ENABLED(CONFIG_OF) && np) {
@@ -730,11 +730,9 @@ static int ar933x_uart_probe(struct platform_device *pdev)
730730
if (id >= CONFIG_SERIAL_AR933X_NR_UARTS)
731731
return -EINVAL;
732732

733-
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
734-
if (!irq_res) {
735-
dev_err(&pdev->dev, "no IRQ resource\n");
736-
return -EINVAL;
737-
}
733+
irq = platform_get_irq(pdev, 0);
734+
if (irq < 0)
735+
return irq;
738736

739737
up = devm_kzalloc(&pdev->dev, sizeof(struct ar933x_uart_port),
740738
GFP_KERNEL);
@@ -766,7 +764,7 @@ static int ar933x_uart_probe(struct platform_device *pdev)
766764

767765
port->mapbase = mem_res->start;
768766
port->line = id;
769-
port->irq = irq_res->start;
767+
port->irq = irq;
770768
port->dev = &pdev->dev;
771769
port->type = PORT_AR933X;
772770
port->iotype = UPIO_MEM32;

0 commit comments

Comments
 (0)