Skip to content

Commit

Permalink
powerpc/pci: Clean up direct access to sysdata by RTAS
Browse files Browse the repository at this point in the history
We shouldn't directly access sysdata to get the device node but call
pci_bus_to_OF_node() for this purpose.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Kumar Gala authored and Benjamin Herrenschmidt committed May 21, 2009
1 parent 9527226 commit 2f52297
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions arch/powerpc/kernel/rtas_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,
{
struct device_node *busdn, *dn;

if (bus->self)
busdn = pci_device_to_OF_node(bus->self);
else
busdn = bus->sysdata; /* must be a phb */
busdn = pci_bus_to_OF_node(bus);

/* Search only direct children of the bus */
for (dn = busdn->child; dn; dn = dn->sibling) {
Expand Down Expand Up @@ -140,10 +137,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,
{
struct device_node *busdn, *dn;

if (bus->self)
busdn = pci_device_to_OF_node(bus->self);
else
busdn = bus->sysdata; /* must be a phb */
busdn = pci_bus_to_OF_node(bus);

/* Search only direct children of the bus */
for (dn = busdn->child; dn; dn = dn->sibling) {
Expand Down

0 comments on commit 2f52297

Please sign in to comment.