Skip to content

Commit 4f32612

Browse files
Lorenzo PieralisiKAGA-KOKO
authored andcommitted
PCI: iproc: Implement MSI controller node detection with of_msi_xlate()
The functionality implemented in the iproc driver in order to detect an OF MSI controller node is now fully implemented in of_msi_xlate(). Replace the current msi-map/msi-parent parsing code with of_msi_xlate(). Since of_msi_xlate() is also a deviceID mapping API, pass in a fictitious 0 as deviceID - the driver only requires detecting the OF MSI controller node not the deviceID mapping per-se (of_msi_xlate() return value is ignored for the same reason). Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frank Li <Frank.Li@nxp.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20251021124103.198419-5-lpieralisi@kernel.org
1 parent ebb922c commit 4f32612

1 file changed

Lines changed: 5 additions & 17 deletions

File tree

drivers/pci/controller/pcie-iproc.c

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/irqchip/arm-gic-v3.h>
1818
#include <linux/platform_device.h>
1919
#include <linux/of_address.h>
20+
#include <linux/of_irq.h>
2021
#include <linux/of_pci.h>
2122
#include <linux/of_platform.h>
2223
#include <linux/phy/phy.h>
@@ -1337,29 +1338,16 @@ static int iproc_pcie_msi_steer(struct iproc_pcie *pcie,
13371338

13381339
static int iproc_pcie_msi_enable(struct iproc_pcie *pcie)
13391340
{
1340-
struct device_node *msi_node;
1341+
struct device_node *msi_node = NULL;
13411342
int ret;
13421343

13431344
/*
13441345
* Either the "msi-parent" or the "msi-map" phandle needs to exist
13451346
* for us to obtain the MSI node.
13461347
*/
1347-
1348-
msi_node = of_parse_phandle(pcie->dev->of_node, "msi-parent", 0);
1349-
if (!msi_node) {
1350-
const __be32 *msi_map = NULL;
1351-
int len;
1352-
u32 phandle;
1353-
1354-
msi_map = of_get_property(pcie->dev->of_node, "msi-map", &len);
1355-
if (!msi_map)
1356-
return -ENODEV;
1357-
1358-
phandle = be32_to_cpup(msi_map + 1);
1359-
msi_node = of_find_node_by_phandle(phandle);
1360-
if (!msi_node)
1361-
return -ENODEV;
1362-
}
1348+
of_msi_xlate(pcie->dev, &msi_node, 0);
1349+
if (!msi_node)
1350+
return -ENODEV;
13631351

13641352
/*
13651353
* Certain revisions of the iProc PCIe controller require additional

0 commit comments

Comments
 (0)