PCI: mediatek: Add new method to get irq number
authorChuanjia Liu <chuanjia.liu@mediatek.com>
Mon, 23 Aug 2021 03:27:57 +0000 (11:27 +0800)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 26 Aug 2021 12:48:49 +0000 (13:48 +0100)
Use platform_get_irq_byname() to get the irq number
if the "interrupt-names" property is defined.

Link: https://lore.kernel.org/r/20210823032800.1660-4-chuanjia.liu@mediatek.com
Signed-off-by: Chuanjia Liu <chuanjia.liu@mediatek.com>
[lorenzo.pieralisi@arm.com: commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Ryder Lee <ryder.lee@mediatek.com>
drivers/pci/controller/pcie-mediatek.c

index 4296d9e..19e35ac 100644 (file)
@@ -654,7 +654,11 @@ static int mtk_pcie_setup_irq(struct mtk_pcie_port *port,
                return err;
        }
 
-       port->irq = platform_get_irq(pdev, port->slot);
+       if (of_find_property(dev->of_node, "interrupt-names", NULL))
+               port->irq = platform_get_irq_byname(pdev, "pcie_irq");
+       else
+               port->irq = platform_get_irq(pdev, port->slot);
+
        if (port->irq < 0)
                return port->irq;