aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/pci-bridge.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 17:54:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 17:54:02 -0400
commitacb41c0f928fdb84a1c3753ac92c534a2a0f08d2 (patch)
tree4bf92f1c2b1f36fa68d3e77d646b04b863e1a7e4 /arch/powerpc/include/asm/pci-bridge.h
parent8181780c163e7111f15619067cfa044172d532e1 (diff)
parentef3b4f8cc20e80c767e47b848fb7512770ab80d7 (diff)
Merge branch 'of-pci' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'of-pci' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: pci/of: Consolidate pci_bus_to_OF_node() pci/of: Consolidate pci_device_to_OF_node() x86/devicetree: Use generic PCI <-> OF matching microblaze/pci: Move the remains of pci_32.c to pci-common.c microblaze/pci: Remove powermac originated cruft pci/of: Match PCI devices to OF nodes dynamically
Diffstat (limited to 'arch/powerpc/include/asm/pci-bridge.h')
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h29
1 files changed, 3 insertions, 26 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index b90dbf8e5cd..90bd3ed4816 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -171,15 +171,9 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
171 171
172#ifndef CONFIG_PPC64 172#ifndef CONFIG_PPC64
173 173
174static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) 174extern int pci_device_from_OF_node(struct device_node *node,
175{ 175 u8 *bus, u8 *devfn);
176 struct pci_controller *host; 176extern void pci_create_OF_bus_map(void);
177
178 if (bus->self)
179 return pci_device_to_OF_node(bus->self);
180 host = pci_bus_to_host(bus);
181 return host ? host->dn : NULL;
182}
183 177
184static inline int isa_vaddr_is_ioport(void __iomem *address) 178static inline int isa_vaddr_is_ioport(void __iomem *address)
185{ 179{
@@ -223,17 +217,8 @@ struct pci_dn {
223/* Get the pointer to a device_node's pci_dn */ 217/* Get the pointer to a device_node's pci_dn */
224#define PCI_DN(dn) ((struct pci_dn *) (dn)->data) 218#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)
225 219
226extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
227extern void * update_dn_pci_info(struct device_node *dn, void *data); 220extern void * update_dn_pci_info(struct device_node *dn, void *data);
228 221
229/* Get a device_node from a pci_dev. This code must be fast except
230 * in the case where the sysdata is incorrect and needs to be fixed
231 * up (this will only happen once). */
232static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
233{
234 return dev->dev.of_node ? dev->dev.of_node : fetch_dev_dn(dev);
235}
236
237static inline int pci_device_from_OF_node(struct device_node *np, 222static inline int pci_device_from_OF_node(struct device_node *np,
238 u8 *bus, u8 *devfn) 223 u8 *bus, u8 *devfn)
239{ 224{
@@ -244,14 +229,6 @@ static inline int pci_device_from_OF_node(struct device_node *np,
244 return 0; 229 return 0;
245} 230}
246 231
247static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
248{
249 if (bus->self)
250 return pci_device_to_OF_node(bus->self);
251 else
252 return bus->dev.of_node; /* Must be root bus (PHB) */
253}
254
255/** Find the bus corresponding to the indicated device node */ 232/** Find the bus corresponding to the indicated device node */
256extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn); 233extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);
257 234