powerpc/pci: clean up direct access to sysdata by indirect ops
Subsystems (4)
PATCH 1/9 powerpc/pci: clean up direct access to sysdata by indirect ops
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.
--- arch/powerpc/sysdev/indirect_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/sysdev/indirect_pci.c +2 -2
@@ -24,7 +24,7 @@ static int indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { - struct pci_controller *hose = bus->sysdata; + struct pci_controller *hose = pci_bus_to_host(bus);volatile void __iomem *cfg_data;u8 cfg_type =0 ;u32 bus_no, reg;
@@ -82,7 +82,7 @@ static int indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { - struct pci_controller *hose = bus->sysdata; + struct pci_controller *hose = pci_bus_to_host(bus);volatile void __iomem *cfg_data;u8 cfg_type =0 ;u32 bus_no, reg;
Signature · 1 line
1.6.0.6
PATCH 2/9 powerpc/pci: clean up direct access to sysdata by FSL 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.
--- arch/powerpc/sysdev/fsl_pci.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/sysdev/fsl_pci.c +3 -3
@@ -188,7 +188,7 @@ static void __init setup_pci_pcsrbar(struct pci_controller *hose)void fsl_pcibios_fixup_bus (struct pci_bus *bus) { -struct pci_controller *hose = (struct pci_controller *) bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);int i; if ((bus->parent == hose->bus) &&
@@ -324,7 +324,7 @@ struct mpc83xx_pcie_priv {static int mpc83xx_pcie_exclude_device (struct pci_bus *bus,unsigned int devfn) { -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);if (hose->indirect_type &PPC_INDIRECT_TYPE_NO_PCIE_LINK )return PCIBIOS_DEVICE_NOT_FOUND ;
@@ -350,7 +350,7 @@ static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn)static void __iomem *mpc83xx_pcie_remap_cfg (struct pci_bus *bus,unsigned int devfn,int offset) { -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);struct mpc83xx_pcie_priv *pcie = hose->dn->data;u8 bus_no = bus->number - hose->first_busno;u32 dev_base = bus_no <<24 | devfn <<16 ;
Signature · 1 line
1.6.0.6
PATCH 3/9 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.
--- arch/powerpc/platforms/52xx/efika.c | 4 ++-- arch/powerpc/platforms/52xx/mpc52xx_pci.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/52xx/efika.c +2 -2
@@ -34,7 +34,7 @@static int rtas_read_config (struct pci_bus *bus,unsigned int devfn,int offset,int len,u32 * val) { -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);unsigned long addr = (offset &0xff ) | ((devfn &0xff ) <<8 ) | (((bus->number - hose->first_busno) &0xff ) <<16 ) | (hose->global_number <<24 );
@@ -49,7 +49,7 @@ static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,static int rtas_write_config (struct pci_bus *bus,unsigned int devfn,int offset,int len,u32 val) { -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);unsigned long addr = (offset &0xff ) | ((devfn &0xff ) <<8 ) | (((bus->number - hose->first_busno) &0xff ) <<16 ) | (hose->global_number <<24 );
arch/powerpc/platforms/52xx/mpc52xx_pci.c +2 -2
@@ -107,7 +107,7 @@ static int mpc52xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { - struct pci_controller *hose = bus->sysdata; + struct pci_controller *hose = pci_bus_to_host(bus);u32 value;if (ppc_md.pci_exclude_device)
@@ -164,7 +164,7 @@ static int mpc52xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { - struct pci_controller *hose = bus->sysdata; + struct pci_controller *hose = pci_bus_to_host(bus);u32 value, mask;if (ppc_md.pci_exclude_device)
Signature · 1 line
1.6.0.6
PATCH 4/9 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.
--- arch/powerpc/sysdev/ppc4xx_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/sysdev/ppc4xx_pci.c +2 -2
@@ -1295,7 +1295,7 @@ static void __iomem *ppc4xx_pciex_get_config_base(struct ppc4xx_pciex_port *portstatic 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;
Signature · 1 line
1.6.0.6
PATCH 5/9 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.
--- arch/powerpc/platforms/chrp/pci.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/chrp/pci.c +4 -4
@@ -34,7 +34,7 @@ int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off, int len, u32 *val) {volatile void __iomem *cfg_data; -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);if (bus->number >7 )return PCIBIOS_DEVICE_NOT_FOUND ;
@@ -61,7 +61,7 @@ int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off, int len, u32 val) {volatile void __iomem *cfg_data; -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);if (bus->number >7 )return PCIBIOS_DEVICE_NOT_FOUND ;
@@ -96,7 +96,7 @@ static struct pci_ops gg2_pci_ops =int rtas_read_config (struct pci_bus *bus,unsigned int devfn,int offset,int len,u32 *val) { -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);unsigned long addr = (offset &0xff ) | ((devfn &0xff ) <<8 ) | (((bus->number - hose->first_busno) &0xff ) <<16 ) | (hose->global_number <<24 );
@@ -111,7 +111,7 @@ int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,int rtas_write_config (struct pci_bus *bus,unsigned int devfn,int offset,int len,u32 val) { -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);unsigned long addr = (offset &0xff ) | ((devfn &0xff ) <<8 ) | (((bus->number - hose->first_busno) &0xff ) <<16 ) | (hose->global_number <<24 );
Signature · 1 line
1.6.0.6
PATCH 6/9 powerpc/pci: clean up direct access to sysdata on tsi108 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.
--- arch/powerpc/sysdev/tsi108_pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/sysdev/tsi108_pci.c +2 -2
@@ -63,7 +63,7 @@ tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfunc, int offset, int len, u32 val) { volatile unsigned char *cfg_addr; -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);if (ppc_md.pci_exclude_device)if (ppc_md.pci_exclude_device (hose, bus->number, devfunc))
@@ -149,7 +149,7 @@ tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 * val) {volatile unsigned char *cfg_addr; -struct pci_controller *hose = bus->sysdata; +struct pci_controller *hose =pci_bus_to_host (bus);u32 temp;if (ppc_md.pci_exclude_device)
Signature · 1 line
1.6.0.6
PATCH 7/9 powerpc/pci: clean up direct access to sysdata by powermac platforms
We shouldn't directly access sysdata to get the device node but call pci_bus_to_OF_node() for this purpose.
--- arch/powerpc/platforms/powermac/setup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/platforms/powermac/setup.c +1 -1
@@ -655,7 +655,7 @@ static int __init pmac_probe(void)/* Move that to pci.c */ static int pmac_pci_probe_mode (struct pci_bus *bus) { -struct device_node *node = bus->sysdata; +struct device_node *node =pci_bus_to_OF_node (bus);/* We need to use normal PCI probing for the AGP bus, * since the device for the AGP bridge isn't in the tree.
Signature · 1 line
1.6.0.6
PATCH 8/9 powerpc/pci: clean up direct access to sysdata by RTAS
We shouldn't directly access sysdata to get the device node but call pci_bus_to_OF_node() for this purpose.
--- arch/powerpc/kernel/rtas_pci.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-)
arch/powerpc/kernel/rtas_pci.c +2 -8
@@ -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) {
Signature · 1 line
1.6.0.6
PATCH 9/9 powerpc/pci: clean up direct access to sysdata by celleb platforms
We shouldn't directly access sysdata to get the device node to just go get the pci_controller. We can call pci_bus_to_host() for this purpose.
--- arch/powerpc/platforms/cell/celleb_pci.c | 10 ++-------- arch/powerpc/platforms/cell/celleb_scc_epci.c | 13 ++----------- arch/powerpc/platforms/cell/celleb_scc_pciex.c | 12 ++---------- 3 files changed, 6 insertions(+), 29 deletions(-)
arch/powerpc/platforms/cell/celleb_pci.c +2 -8
@@ -162,8 +162,7 @@ static int celleb_fake_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) { char *config; -struct device_node *node; -struct pci_controller *hose; +struct pci_controller *hose =pci_bus_to_host (bus);unsigned int devno = devfn >>3 ;unsigned int fn = devfn &0x7 ;
@@ -171,8 +170,6 @@ static int celleb_fake_pci_read_config(struct pci_bus *bus,BUG_ON (where % size);pr_debug (" fake read: bus=0x%x, " , bus->number); - node = (struct device_node *)bus->sysdata; - hose =pci_find_hose_for_OF_device (node); config =get_fake_config_start (hose, devno, fn);pr_debug ("devno=0x%x, where=0x%x, size=0x%x, " , devno, where, size);
@@ -192,8 +189,7 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) { char *config; -struct device_node *node; -struct pci_controller *hose; +struct pci_controller *hose =pci_bus_to_host (bus);struct celleb_pci_resource *res;unsigned int devno = devfn >>3 ;unsigned int fn = devfn &0x7 ;
@@ -201,8 +197,6 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,/* allignment check */ BUG_ON (where % size); - node = (struct device_node *)bus->sysdata; - hose =pci_find_hose_for_OF_device (node); config =get_fake_config_start (hose, devno, fn);if (!config)
arch/powerpc/platforms/cell/celleb_scc_epci.c +2 -11
@@ -134,15 +134,11 @@ static int celleb_epci_read_config(struct pci_bus *bus, {PCI_IO_ADDR epci_base;PCI_IO_ADDR addr; -struct device_node *node; -struct pci_controller *hose; +struct pci_controller *hose =pci_bus_to_host (bus);/* allignment check */ BUG_ON (where % size); - node = (struct device_node *)bus->sysdata; - hose =pci_find_hose_for_OF_device (node); -if (!celleb_epci_get_epci_cfg (hose))return PCIBIOS_DEVICE_NOT_FOUND ;
@@ -198,16 +194,11 @@ static int celleb_epci_write_config(struct pci_bus *bus, {PCI_IO_ADDR epci_base;PCI_IO_ADDR addr; -struct device_node *node; -struct pci_controller *hose; +struct pci_controller *hose =pci_bus_to_host (bus);/* allignment check */ BUG_ON (where % size); - node = (struct device_node *)bus->sysdata; - hose =pci_find_hose_for_OF_device (node); - -if (!celleb_epci_get_epci_cfg (hose))return PCIBIOS_DEVICE_NOT_FOUND ;
arch/powerpc/platforms/cell/celleb_scc_pciex.c +2 -10
@@ -366,11 +366,7 @@ static void config_write_pciex_rc(unsigned int __iomem *base, uint32_t where,static int scc_pciex_read_config (struct pci_bus *bus,unsigned int devfn,int where,int size,unsigned int *val) { -struct device_node *dn; -struct pci_controller *phb; - - dn = bus->sysdata; - phb =pci_find_hose_for_OF_device (dn); +struct pci_controller *phb =pci_bus_to_host (bus);if (bus->number == phb->first_busno &&PCI_SLOT (devfn) !=1 ) { *val = ~0 ;
@@ -389,11 +385,7 @@ static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn,static int scc_pciex_write_config (struct pci_bus *bus,unsigned int devfn,int where,int size,unsigned int val) { -struct device_node *dn; -struct pci_controller *phb; - - dn = bus->sysdata; - phb =pci_find_hose_for_OF_device (dn); +struct pci_controller *phb =pci_bus_to_host (bus);if (bus->number == phb->first_busno &&PCI_SLOT (devfn) !=1 )return PCIBIOS_DEVICE_NOT_FOUND ;
Signature · 1 line
1.6.0.6