aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/celleb_scc_epci.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2009-04-29 23:10:15 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-05-21 01:44:24 -0400
commit58513dc40d8e01f0c0ccea4cdcbc32e9dcee62fd (patch)
tree585debc810954d0cac80619c85d5a5ab50ceda41 /arch/powerpc/platforms/cell/celleb_scc_epci.c
parent2f52297665d2ebfaa24406003cf9e5a7b635f47d (diff)
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. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/celleb_scc_epci.c')
-rw-r--r--arch/powerpc/platforms/cell/celleb_scc_epci.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c
index 48ec88a38a12..05b0db3ef638 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_epci.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c
@@ -134,15 +134,11 @@ static int celleb_epci_read_config(struct pci_bus *bus,
134{ 134{
135 PCI_IO_ADDR epci_base; 135 PCI_IO_ADDR epci_base;
136 PCI_IO_ADDR addr; 136 PCI_IO_ADDR addr;
137 struct device_node *node; 137 struct pci_controller *hose = pci_bus_to_host(bus);
138 struct pci_controller *hose;
139 138
140 /* allignment check */ 139 /* allignment check */
141 BUG_ON(where % size); 140 BUG_ON(where % size);
142 141
143 node = (struct device_node *)bus->sysdata;
144 hose = pci_find_hose_for_OF_device(node);
145
146 if (!celleb_epci_get_epci_cfg(hose)) 142 if (!celleb_epci_get_epci_cfg(hose))
147 return PCIBIOS_DEVICE_NOT_FOUND; 143 return PCIBIOS_DEVICE_NOT_FOUND;
148 144
@@ -198,16 +194,11 @@ static int celleb_epci_write_config(struct pci_bus *bus,
198{ 194{
199 PCI_IO_ADDR epci_base; 195 PCI_IO_ADDR epci_base;
200 PCI_IO_ADDR addr; 196 PCI_IO_ADDR addr;
201 struct device_node *node; 197 struct pci_controller *hose = pci_bus_to_host(bus);
202 struct pci_controller *hose;
203 198
204 /* allignment check */ 199 /* allignment check */
205 BUG_ON(where % size); 200 BUG_ON(where % size);
206 201
207 node = (struct device_node *)bus->sysdata;
208 hose = pci_find_hose_for_OF_device(node);
209
210
211 if (!celleb_epci_get_epci_cfg(hose)) 202 if (!celleb_epci_get_epci_cfg(hose))
212 return PCIBIOS_DEVICE_NOT_FOUND; 203 return PCIBIOS_DEVICE_NOT_FOUND;
213 204