Skip to content

Commit f63f1dd

Browse files
prabhakarladgregkh
authored andcommitted
serial: vt8500: 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 6030227 commit f63f1dd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/tty/serial/vt8500_serial.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,21 +621,25 @@ static const struct of_device_id wmt_dt_ids[] = {
621621
static int vt8500_serial_probe(struct platform_device *pdev)
622622
{
623623
struct vt8500_port *vt8500_port;
624-
struct resource *mmres, *irqres;
624+
struct resource *mmres;
625625
struct device_node *np = pdev->dev.of_node;
626626
const unsigned int *flags;
627627
int ret;
628628
int port;
629+
int irq;
629630

630631
flags = of_device_get_match_data(&pdev->dev);
631632
if (!flags)
632633
return -EINVAL;
633634

634635
mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
635-
irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
636-
if (!mmres || !irqres)
636+
if (!mmres)
637637
return -ENODEV;
638638

639+
irq = platform_get_irq(pdev, 0);
640+
if (irq < 0)
641+
return irq;
642+
639643
if (np) {
640644
port = of_alias_get_id(np, "serial");
641645
if (port >= VT8500_MAX_PORTS)
@@ -688,7 +692,7 @@ static int vt8500_serial_probe(struct platform_device *pdev)
688692
vt8500_port->uart.type = PORT_VT8500;
689693
vt8500_port->uart.iotype = UPIO_MEM;
690694
vt8500_port->uart.mapbase = mmres->start;
691-
vt8500_port->uart.irq = irqres->start;
695+
vt8500_port->uart.irq = irq;
692696
vt8500_port->uart.fifosize = 16;
693697
vt8500_port->uart.ops = &vt8500_uart_pops;
694698
vt8500_port->uart.line = port;

0 commit comments

Comments
 (0)