aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-06 23:09:47 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-06-07 19:08:43 -0400
commit64099d981c9916ec4a485b3ffbb89fa877fc595f (patch)
tree363409e3a5bafdbbfbeffe6f93f1c2338f1c893b /arch
parent3d5fe5a65af9c0b609d6e26b8d63fe5923c4e512 (diff)
pci/of: Consolidate pci_device_to_OF_node()
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/include/asm/pci-bridge.h5
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h5
-rw-r--r--arch/sparc/include/asm/pci_32.h3
-rw-r--r--arch/sparc/include/asm/pci_64.h3
-rw-r--r--arch/sparc/kernel/pci.c6
-rw-r--r--arch/sparc/kernel/pcic.c8
-rw-r--r--arch/x86/include/asm/prom.h5
7 files changed, 0 insertions, 35 deletions
diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h
index 6bddc0701a07..0d74d031e2a3 100644
--- a/arch/microblaze/include/asm/pci-bridge.h
+++ b/arch/microblaze/include/asm/pci-bridge.h
@@ -102,11 +102,6 @@ struct pci_controller {
102}; 102};
103 103
104#ifdef CONFIG_PCI 104#ifdef CONFIG_PCI
105static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
106{
107 return dev->dev.of_node;
108}
109
110static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) 105static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
111{ 106{
112 return bus->dev.of_node; 107 return bus->dev.of_node;
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 3e6869476e55..578060ef99ad 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
169 return bus->sysdata; 169 return bus->sysdata;
170} 170}
171 171
172static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
173{
174 return dev->dev.of_node;
175}
176
177static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) 172static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
178{ 173{
179 return bus->dev.of_node; 174 return bus->dev.of_node;
diff --git a/arch/sparc/include/asm/pci_32.h b/arch/sparc/include/asm/pci_32.h
index 332ac9ab36bc..4d0c39a931c5 100644
--- a/arch/sparc/include/asm/pci_32.h
+++ b/arch/sparc/include/asm/pci_32.h
@@ -42,9 +42,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
42} 42}
43#endif 43#endif
44 44
45struct device_node;
46extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
47
48#endif /* __KERNEL__ */ 45#endif /* __KERNEL__ */
49 46
50/* generic pci stuff */ 47/* generic pci stuff */
diff --git a/arch/sparc/include/asm/pci_64.h b/arch/sparc/include/asm/pci_64.h
index 948b686ec089..2614d96141c9 100644
--- a/arch/sparc/include/asm/pci_64.h
+++ b/arch/sparc/include/asm/pci_64.h
@@ -91,9 +91,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
91 return PCI_IRQ_NONE; 91 return PCI_IRQ_NONE;
92} 92}
93 93
94struct device_node;
95extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
96
97#define HAVE_ARCH_PCI_RESOURCE_TO_USER 94#define HAVE_ARCH_PCI_RESOURCE_TO_USER
98extern void pci_resource_to_user(const struct pci_dev *dev, int bar, 95extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
99 const struct resource *rsrc, 96 const struct resource *rsrc,
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index e539d23dec9d..80a87e2a3e7c 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -1021,12 +1021,6 @@ void arch_teardown_msi_irq(unsigned int irq)
1021} 1021}
1022#endif /* !(CONFIG_PCI_MSI) */ 1022#endif /* !(CONFIG_PCI_MSI) */
1023 1023
1024struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
1025{
1026 return pdev->dev.of_node;
1027}
1028EXPORT_SYMBOL(pci_device_to_OF_node);
1029
1030static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit) 1024static void ali_sound_dma_hack(struct pci_dev *pdev, int set_bit)
1031{ 1025{
1032 struct pci_dev *ali_isa_bridge; 1026 struct pci_dev *ali_isa_bridge;
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 948601a066ff..a19f04195478 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -885,14 +885,6 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource)
885 return -ENXIO; 885 return -ENXIO;
886} 886}
887 887
888struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
889{
890 struct pcidev_cookie *pc = pdev->sysdata;
891
892 return pc->prom_node;
893}
894EXPORT_SYMBOL(pci_device_to_OF_node);
895
896/* 888/*
897 * This probably belongs here rather than ioport.c because 889 * This probably belongs here rather than ioport.c because
898 * we do not want this crud linked into SBus kernels. 890 * we do not want this crud linked into SBus kernels.
diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h
index 971e0b46446e..dd6066a56346 100644
--- a/arch/x86/include/asm/prom.h
+++ b/arch/x86/include/asm/prom.h
@@ -31,11 +31,6 @@ extern void x86_add_irq_domains(void);
31void __cpuinit x86_of_pci_init(void); 31void __cpuinit x86_of_pci_init(void);
32void x86_dtb_init(void); 32void x86_dtb_init(void);
33 33
34static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
35{
36 return pdev ? pdev->dev.of_node : NULL;
37}
38
39static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) 34static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
40{ 35{
41 return pci_device_to_OF_node(bus->self); 36 return pci_device_to_OF_node(bus->self);