[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210823032800.1660-4-chuanjia.liu@mediatek.com>
Date: Mon, 23 Aug 2021 11:27:57 +0800
From: Chuanjia Liu <chuanjia.liu@...iatek.com>
To: <robh+dt@...nel.org>, <bhelgaas@...gle.com>,
<matthias.bgg@...il.com>, <lorenzo.pieralisi@....com>
CC: <ryder.lee@...iatek.com>, <jianjun.wang@...iatek.com>,
<yong.wu@...iatek.com>, <chuanjia.liu@...iatek.com>,
<linux-pci@...r.kernel.org>, <linux-mediatek@...ts.infradead.org>,
<devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH v12 3/6] PCI: mediatek: Add new method to get irq number
Use platform_get_irq_byname() to get the irq number
if the property of "interrupt-names" is defined.
Signed-off-by: Chuanjia Liu <chuanjia.liu@...iatek.com>
Acked-by: Ryder Lee <ryder.lee@...iatek.com>
---
drivers/pci/controller/pcie-mediatek.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index 4296d9e04240..19e35ac62d43 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -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;
--
2.18.0
Powered by blists - more mailing lists