Commit 1266c166 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[PATCH] ppc64: pci_bus_to_host() simplification

The pci_bus_to_host() inline function used on ppc64 to find the pci_contoller
structure a give pci_bus resides on used to contain bogus tree walking code,
which fortunately ended up never beeing necessary since "sysdata" always points
to a device_node structure that has the proper "phb" field (even if it is not
the device-node of the actual P2P, which happens during boot).
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 33e0e11d
...@@ -88,17 +88,9 @@ extern void phbs_remap_io(void); ...@@ -88,17 +88,9 @@ extern void phbs_remap_io(void);
static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
{ {
struct device_node *busdn; struct device_node *busdn = bus->sysdata;
busdn = bus->sysdata; BUG_ON(busdn == NULL);
if (busdn == 0) {
struct pci_bus *b;
for (b = bus->parent; b && bus->sysdata == 0; b = b->parent)
;
busdn = b->sysdata;
}
if (busdn == NULL)
return NULL;
return busdn->phb; return busdn->phb;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment