Commit f159edae authored by Kumar Gala's avatar Kumar Gala Committed by Benjamin Herrenschmidt

powerpc/pci: Clean up direct access to sysdata by 4xx 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: default avatarKumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 5b21fb8e
...@@ -1295,7 +1295,7 @@ static void __iomem *ppc4xx_pciex_get_config_base(struct ppc4xx_pciex_port *port ...@@ -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, static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 *val) 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 = struct ppc4xx_pciex_port *port =
&ppc4xx_pciex_ports[hose->indirect_type]; &ppc4xx_pciex_ports[hose->indirect_type];
void __iomem *addr; void __iomem *addr;
...@@ -1352,7 +1352,7 @@ static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn, ...@@ -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, static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 val) 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 = struct ppc4xx_pciex_port *port =
&ppc4xx_pciex_ports[hose->indirect_type]; &ppc4xx_pciex_ports[hose->indirect_type];
void __iomem *addr; void __iomem *addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment