]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/pci: Clean up direct access to sysdata by RTAS
authorKumar Gala <galak@kernel.crashing.org>
Thu, 30 Apr 2009 03:10:14 +0000 (03:10 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 21 May 2009 05:44:23 +0000 (15:44 +1000)
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>
arch/powerpc/kernel/rtas_pci.c

index 8869001ab5d7691baae77296e6ca4bdd7aec010d..54e66da8f743f4363729d92d46a53404a56e2003 100644 (file)
@@ -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) {
@@ -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) {