]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
pci/of: Consolidate pci_device_to_OF_node()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 7 Apr 2011 03:09:47 +0000 (13:09 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 7 Jun 2011 23:08:43 +0000 (09:08 +1000)
All archs do more or less the same thing now, move it into
a single generic place.

I chose pci.h rather than of_pci.h to avoid having to change
all call-sites to include the later.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
arch/microblaze/include/asm/pci-bridge.h
arch/powerpc/include/asm/pci-bridge.h
arch/sparc/include/asm/pci_32.h
arch/sparc/include/asm/pci_64.h
arch/sparc/kernel/pci.c
arch/sparc/kernel/pcic.c
arch/x86/include/asm/prom.h
include/linux/pci.h

index 6bddc0701a075de54e4b3104b1a7398bde2a478f..0d74d031e2a3184282a503213fe6929f0e965a82 100644 (file)
@@ -102,11 +102,6 @@ struct pci_controller {
 };
 
 #ifdef CONFIG_PCI
-static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
-{
-       return dev->dev.of_node;
-}
-
 static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
 {
        return bus->dev.of_node;
index 3e6869476e55290340e2fe7f0148bf6ec67249fd..578060ef99ad6df3abb50ba7c7e3cb1e3e4044e3 100644 (file)
@@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
        return bus->sysdata;
 }
 
-static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
-{
-       return dev->dev.of_node;
-}
-
 static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
 {
        return bus->dev.of_node;
index 332ac9ab36bc61c486e787d4cf962ae39c067d29..4d0c39a931c59a4ac1dcc75c03d1e67ec8676edb 100644 (file)
@@ -42,9 +42,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
 }
 #endif
 
-struct device_node;
-extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
-
 #endif /* __KERNEL__ */
 
 /* generic pci stuff */
index 948b686ec0894a89e30bdb1716626934a570d2fb..2614d96141c96a970b1d57959f68bff4fa0a3d96 100644 (file)
@@ -91,9 +91,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
        return PCI_IRQ_NONE;
 }
 
-struct device_node;
-extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
-
 #define HAVE_ARCH_PCI_RESOURCE_TO_USER
 extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
                                 const struct resource *rsrc,
index e539d23dec9d0db02202e5f89e23780026428446..80a87e2a3e7cb7b05c1ce04c38fd2bf5586306f0 100644 (file)
@@ -1021,12 +1021,6 @@ void arch_teardown_msi_irq(unsigned int irq)
 }
 #endif /* !(CONFIG_PCI_MSI) */
 
-struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
-{
-       return pdev->dev.of_node;
-}
-EXPORT_SYMBOL(pci_device_to_OF_node);
-
 static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit)
 {
        struct pci_dev *ali_isa_bridge;
index 948601a066ff9b5d6d53769a3fb0186770cbb2bd..a19f04195478a425d22a3da2264b8cf2aa3ce966 100644 (file)
@@ -885,14 +885,6 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource)
        return -ENXIO;
 }
 
-struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
-{
-       struct pcidev_cookie *pc = pdev->sysdata;
-
-       return pc->prom_node;
-}
-EXPORT_SYMBOL(pci_device_to_OF_node);
-
 /*
  * This probably belongs here rather than ioport.c because
  * we do not want this crud linked into SBus kernels.
index 971e0b46446e091761ffe759d4f056d484fe980c..dd6066a56346e12febdb30b19e84c5037c43c4ae 100644 (file)
@@ -31,11 +31,6 @@ extern void x86_add_irq_domains(void);
 void __cpuinit x86_of_pci_init(void);
 void x86_dtb_init(void);
 
-static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
-{
-       return pdev ? pdev->dev.of_node : NULL;
-}
-
 static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
 {
        return pci_device_to_OF_node(bus->self);
index e5086e9a9bf76e3fa22e1153a9d7525a852ab2f9..795e6a56d8cd767e0ca3053c37936479554d325c 100644 (file)
@@ -1600,6 +1600,11 @@ extern void pci_release_bus_of_node(struct pci_bus *bus);
 /* Arch may override this (weak) */
 extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
 
+static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
+{
+       return pdev ? pdev->dev.of_node : NULL;
+}
+
 #else /* CONFIG_OF */
 static inline void pci_set_of_node(struct pci_dev *dev) { }
 static inline void pci_release_of_node(struct pci_dev *dev) { }