Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Lorenzo Pieralisi and committed by
Thomas Gleixner
4f32612f ebb922c9

+5 -17
+5 -17
drivers/pci/controller/pcie-iproc.c
··· 17 17 #include <linux/irqchip/arm-gic-v3.h> 18 18 #include <linux/platform_device.h> 19 19 #include <linux/of_address.h> 20 + #include <linux/of_irq.h> 20 21 #include <linux/of_pci.h> 21 22 #include <linux/of_platform.h> 22 23 #include <linux/phy/phy.h> ··· 1338 1337 1339 1338 static int iproc_pcie_msi_enable(struct iproc_pcie *pcie) 1340 1339 { 1341 - struct device_node *msi_node; 1340 + struct device_node *msi_node = NULL; 1342 1341 int ret; 1343 1342 1344 1343 /* 1345 1344 * Either the "msi-parent" or the "msi-map" phandle needs to exist 1346 1345 * for us to obtain the MSI node. 1347 1346 */ 1348 - 1349 - msi_node = of_parse_phandle(pcie->dev->of_node, "msi-parent", 0); 1350 - if (!msi_node) { 1351 - const __be32 *msi_map = NULL; 1352 - int len; 1353 - u32 phandle; 1354 - 1355 - msi_map = of_get_property(pcie->dev->of_node, "msi-map", &len); 1356 - if (!msi_map) 1357 - return -ENODEV; 1358 - 1359 - phandle = be32_to_cpup(msi_map + 1); 1360 - msi_node = of_find_node_by_phandle(phandle); 1361 - if (!msi_node) 1362 - return -ENODEV; 1363 - } 1347 + of_msi_xlate(pcie->dev, &msi_node, 0); 1348 + if (!msi_node) 1349 + return -ENODEV; 1364 1350 1365 1351 /* 1366 1352 * Certain revisions of the iProc PCIe controller require additional