[8/9] powerpc/pci: clean up direct access to sysdata by RTAS

Submitted by Kumar Gala on April 30, 2009, 1:10 p.m.

Details

Message ID 1241097015-11208-8-git-send-email-galak@kernel.crashing.org
State Accepted, archived
Commit 2f52297665d2ebfaa24406003cf9e5a7b635f47d
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Kumar Gala April 30, 2009, 1:10 p.m.
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>
---
 arch/powerpc/kernel/rtas_pci.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 8869001..54e66da 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -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) {