powerpc/pci: Clean up direct access to sysdata by 4xx platforms
authorKumar Gala <galak@kernel.crashing.org>
Thu, 30 Apr 2009 03:10:10 +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 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>
arch/powerpc/sysdev/ppc4xx_pci.c

index 6a2d473c345a35595a58e5a2a4b1dd637b3dbb84..daefc93ddffec42eb4e15ccfb218e127ccee4032 100644 (file)
@@ -1295,7 +1295,7 @@ static void __iomem *ppc4xx_pciex_get_config_base(struct ppc4xx_pciex_port *port
 static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
                                    int offset, int len, u32 *val)
 {
-       struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
+       struct pci_controller *hose = pci_bus_to_host(bus);
        struct ppc4xx_pciex_port *port =
                &ppc4xx_pciex_ports[hose->indirect_type];
        void __iomem *addr;
@@ -1352,7 +1352,7 @@ static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
 static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
                                     int offset, int len, u32 val)
 {
-       struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
+       struct pci_controller *hose = pci_bus_to_host(bus);
        struct ppc4xx_pciex_port *port =
                &ppc4xx_pciex_ports[hose->indirect_type];
        void __iomem *addr;
This page took 0.040748 seconds and 5 git commands to generate.