aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2009-04-29 23:10:11 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-05-21 01:44:23 -0400
commit8456993ead5e64f5b755df6ac298757af4ceec59 (patch)
treee2542faefb194a53222a5d6fd323244e09fafb76 /arch/powerpc
parentf159edaef31da2ba01511d1f7b2fe22bb048290f (diff)
powerpc/pci: Clean up direct access to sysdata by CHRP platforms
We shouldn't directly access sysdata to get the pci_controller. Instead use pci_bus_to_host() for this purpose. In the future we might have sysdata be a device_node to match ppc64 and unify the code between ppc32 & ppc64. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/chrp/pci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index f6b0c519d5a2..8f67a394b2d0 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -34,7 +34,7 @@ int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
34 int len, u32 *val) 34 int len, u32 *val)
35{ 35{
36 volatile void __iomem *cfg_data; 36 volatile void __iomem *cfg_data;
37 struct pci_controller *hose = bus->sysdata; 37 struct pci_controller *hose = pci_bus_to_host(bus);
38 38
39 if (bus->number > 7) 39 if (bus->number > 7)
40 return PCIBIOS_DEVICE_NOT_FOUND; 40 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -61,7 +61,7 @@ int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
61 int len, u32 val) 61 int len, u32 val)
62{ 62{
63 volatile void __iomem *cfg_data; 63 volatile void __iomem *cfg_data;
64 struct pci_controller *hose = bus->sysdata; 64 struct pci_controller *hose = pci_bus_to_host(bus);
65 65
66 if (bus->number > 7) 66 if (bus->number > 7)
67 return PCIBIOS_DEVICE_NOT_FOUND; 67 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -96,7 +96,7 @@ static struct pci_ops gg2_pci_ops =
96int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 96int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
97 int len, u32 *val) 97 int len, u32 *val)
98{ 98{
99 struct pci_controller *hose = bus->sysdata; 99 struct pci_controller *hose = pci_bus_to_host(bus);
100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
101 | (((bus->number - hose->first_busno) & 0xff) << 16) 101 | (((bus->number - hose->first_busno) & 0xff) << 16)
102 | (hose->global_number << 24); 102 | (hose->global_number << 24);
@@ -111,7 +111,7 @@ int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
111int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 111int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
112 int len, u32 val) 112 int len, u32 val)
113{ 113{
114 struct pci_controller *hose = bus->sysdata; 114 struct pci_controller *hose = pci_bus_to_host(bus);
115 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 115 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
116 | (((bus->number - hose->first_busno) & 0xff) << 16) 116 | (((bus->number - hose->first_busno) & 0xff) << 16)
117 | (hose->global_number << 24); 117 | (hose->global_number << 24);