summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/mach/pci.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-04-11 23:32:28 +0200
committerLinus Walleij <linus.walleij@linaro.org>2013-06-03 08:02:47 +0200
commit14d86e725ed034917bc721cf5deea019857b6cf0 (patch)
tree09ca04236ddfad4c11d04691491e58b1e7597db8 /arch/arm/include/asm/mach/pci.h
parent301d2d87cb4f826a38548f692e1b3c8c23590a9f (diff)
ARM: pci: create pci_common_init_dev()
When working with device tree support for PCI on ARM you run into a problem when mapping IRQs from the device tree irqmaps: doing this the code in drivers/of/of_pci_irq.c will try to find the OF node on the root bridge and this fails, because bus->dev.of_node is NULL, and that in turn boils down to the fact that pci_set_bus_of_node() has called pcibios_get_phb_of_node() from drivers/pci/of.c to obtain the OF node of the bridge or its parent and none is set and thus NULL is returned. Fix this by adding an additional parent argument API for registering PCI bridges on the ARM architecture called pci_common_init_dev(), and pass along this parent to pci_scan_root_bus() called from pcibios_init_hw() in bios32.c and voila: the IRQ mappings start working: the OF node can be retrieved from the parent. Create the old pci_common_init() as a wrapper around the new call. Cc: Mike Rapoport <mike@compulab.co.il> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Benjamin Herrenschmitt <benh@kernel.crashing.org> Reviewed-by: Andrew Murray <andrew.murray@arm.com> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/include/asm/mach/pci.h')
-rw-r--r--arch/arm/include/asm/mach/pci.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
index 7d2c3c84380..038d657e5c2 100644
--- a/arch/arm/include/asm/mach/pci.h
+++ b/arch/arm/include/asm/mach/pci.h
@@ -16,6 +16,7 @@
struct pci_sys_data;
struct pci_ops;
struct pci_bus;
+struct device;
struct hw_pci {
#ifdef CONFIG_PCI_DOMAINS
@@ -68,7 +69,16 @@ struct pci_sys_data {
/*
* Call this with your hw_pci struct to initialise the PCI system.
*/
-void pci_common_init(struct hw_pci *);
+void pci_common_init_dev(struct device *, struct hw_pci *);
+
+/*
+ * Compatibility wrapper for older platforms that do not care about
+ * passing the parent device.
+ */
+static inline void pci_common_init(struct hw_pci *hw)
+{
+ pci_common_init_dev(NULL, hw);
+}
/*
* Setup early fixed I/O mapping.