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

PCI/MSI: Use of_msi_get_domain instead of open-coded "msi-parent" parsing

Now that we have a function that implements the complexity of the
"msi-parent" property parsing, switch to that.

Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

+6 -7
+6 -7
drivers/pci/of.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/pci.h> 15 15 #include <linux/of.h> 16 + #include <linux/of_irq.h> 16 17 #include <linux/of_pci.h> 17 18 #include "pci.h" 18 19 ··· 65 64 struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus) 66 65 { 67 66 #ifdef CONFIG_IRQ_DOMAIN 68 - struct device_node *np; 69 67 struct irq_domain *d; 70 68 71 69 if (!bus->dev.of_node) 72 70 return NULL; 73 71 74 72 /* Start looking for a phandle to an MSI controller. */ 75 - np = of_parse_phandle(bus->dev.of_node, "msi-parent", 0); 73 + d = of_msi_get_domain(&bus->dev, bus->dev.of_node, DOMAIN_BUS_PCI_MSI); 74 + if (d) 75 + return d; 76 76 77 77 /* 78 78 * If we don't have an msi-parent property, look for a domain 79 79 * directly attached to the host bridge. 80 80 */ 81 - if (!np) 82 - np = bus->dev.of_node; 83 - 84 - d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI); 81 + d = irq_find_matching_host(bus->dev.of_node, DOMAIN_BUS_PCI_MSI); 85 82 if (d) 86 83 return d; 87 84 88 - return irq_find_host(np); 85 + return irq_find_host(bus->dev.of_node); 89 86 #else 90 87 return NULL; 91 88 #endif