Commit 2f522976 authored by Kumar Gala's avatar Kumar Gala Committed by Benjamin Herrenschmidt

powerpc/pci: Clean up direct access to sysdata by RTAS

We shouldn't directly access sysdata to get the device node but call
pci_bus_to_OF_node() for this purpose.
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 95272262
...@@ -93,10 +93,7 @@ static int rtas_pci_read_config(struct pci_bus *bus, ...@@ -93,10 +93,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,
{ {
struct device_node *busdn, *dn; struct device_node *busdn, *dn;
if (bus->self) busdn = pci_bus_to_OF_node(bus);
busdn = pci_device_to_OF_node(bus->self);
else
busdn = bus->sysdata; /* must be a phb */
/* Search only direct children of the bus */ /* Search only direct children of the bus */
for (dn = busdn->child; dn; dn = dn->sibling) { for (dn = busdn->child; dn; dn = dn->sibling) {
...@@ -140,10 +137,7 @@ static int rtas_pci_write_config(struct pci_bus *bus, ...@@ -140,10 +137,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,
{ {
struct device_node *busdn, *dn; struct device_node *busdn, *dn;
if (bus->self) busdn = pci_bus_to_OF_node(bus);
busdn = pci_device_to_OF_node(bus->self);
else
busdn = bus->sysdata; /* must be a phb */
/* Search only direct children of the bus */ /* Search only direct children of the bus */
for (dn = busdn->child; dn; dn = dn->sibling) { for (dn = busdn->child; dn; dn = dn->sibling) {
......
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