diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2009-04-29 23:10:09 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-05-21 01:44:22 -0400 |
commit | 5b21fb8e769d2cd798ba2ffb051cd576390a568f (patch) | |
tree | c25db289afca69d3876ddc837bcb770a43f654b2 /arch/powerpc/platforms/52xx/efika.c | |
parent | 8206a110cbaa029570d037c0aeafeb181443b6b8 (diff) |
powerpc/pci: Clean up direct access to sysdata by 52xx 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/platforms/52xx/efika.c')
-rw-r--r-- | arch/powerpc/platforms/52xx/efika.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c index a2068faef6ea..bcc69e1f77c1 100644 --- a/arch/powerpc/platforms/52xx/efika.c +++ b/arch/powerpc/platforms/52xx/efika.c | |||
@@ -34,7 +34,7 @@ | |||
34 | static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, | 34 | static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, |
35 | int len, u32 * val) | 35 | int len, u32 * val) |
36 | { | 36 | { |
37 | struct pci_controller *hose = bus->sysdata; | 37 | struct pci_controller *hose = pci_bus_to_host(bus); |
38 | unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) | 38 | unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) |
39 | | (((bus->number - hose->first_busno) & 0xff) << 16) | 39 | | (((bus->number - hose->first_busno) & 0xff) << 16) |
40 | | (hose->global_number << 24); | 40 | | (hose->global_number << 24); |
@@ -49,7 +49,7 @@ static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, | |||
49 | static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, | 49 | static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, |
50 | int offset, int len, u32 val) | 50 | int offset, int len, u32 val) |
51 | { | 51 | { |
52 | struct pci_controller *hose = bus->sysdata; | 52 | struct pci_controller *hose = pci_bus_to_host(bus); |
53 | unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) | 53 | unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) |
54 | | (((bus->number - hose->first_busno) & 0xff) << 16) | 54 | | (((bus->number - hose->first_busno) & 0xff) << 16) |
55 | | (hose->global_number << 24); | 55 | | (hose->global_number << 24); |