diff options
Diffstat (limited to 'arch/powerpc/kernel/rtas_pci.c')
-rw-r--r-- | arch/powerpc/kernel/rtas_pci.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c index cda02265732..b4a0de79c06 100644 --- a/arch/powerpc/kernel/rtas_pci.c +++ b/arch/powerpc/kernel/rtas_pci.c | |||
@@ -57,7 +57,7 @@ static inline int config_access_valid(struct pci_dn *dn, int where) | |||
57 | 57 | ||
58 | static int of_device_available(struct device_node * dn) | 58 | static int of_device_available(struct device_node * dn) |
59 | { | 59 | { |
60 | char * status; | 60 | const char *status; |
61 | 61 | ||
62 | status = get_property(dn, "status", NULL); | 62 | status = get_property(dn, "status", NULL); |
63 | 63 | ||
@@ -81,8 +81,7 @@ int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val) | |||
81 | if (!config_access_valid(pdn, where)) | 81 | if (!config_access_valid(pdn, where)) |
82 | return PCIBIOS_BAD_REGISTER_NUMBER; | 82 | return PCIBIOS_BAD_REGISTER_NUMBER; |
83 | 83 | ||
84 | addr = ((where & 0xf00) << 20) | (pdn->busno << 16) | | 84 | addr = rtas_config_addr(pdn->busno, pdn->devfn, where); |
85 | (pdn->devfn << 8) | (where & 0xff); | ||
86 | buid = pdn->phb->buid; | 85 | buid = pdn->phb->buid; |
87 | if (buid) { | 86 | if (buid) { |
88 | ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval, | 87 | ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval, |
@@ -134,8 +133,7 @@ int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val) | |||
134 | if (!config_access_valid(pdn, where)) | 133 | if (!config_access_valid(pdn, where)) |
135 | return PCIBIOS_BAD_REGISTER_NUMBER; | 134 | return PCIBIOS_BAD_REGISTER_NUMBER; |
136 | 135 | ||
137 | addr = ((where & 0xf00) << 20) | (pdn->busno << 16) | | 136 | addr = rtas_config_addr(pdn->busno, pdn->devfn, where); |
138 | (pdn->devfn << 8) | (where & 0xff); | ||
139 | buid = pdn->phb->buid; | 137 | buid = pdn->phb->buid; |
140 | if (buid) { | 138 | if (buid) { |
141 | ret = rtas_call(ibm_write_pci_config, 5, 1, NULL, addr, | 139 | ret = rtas_call(ibm_write_pci_config, 5, 1, NULL, addr, |
@@ -178,7 +176,7 @@ struct pci_ops rtas_pci_ops = { | |||
178 | 176 | ||
179 | int is_python(struct device_node *dev) | 177 | int is_python(struct device_node *dev) |
180 | { | 178 | { |
181 | char *model = (char *)get_property(dev, "model", NULL); | 179 | const char *model = get_property(dev, "model", NULL); |
182 | 180 | ||
183 | if (model && strstr(model, "Python")) | 181 | if (model && strstr(model, "Python")) |
184 | return 1; | 182 | return 1; |
@@ -234,7 +232,7 @@ void __init init_pci_config_tokens (void) | |||
234 | unsigned long __devinit get_phb_buid (struct device_node *phb) | 232 | unsigned long __devinit get_phb_buid (struct device_node *phb) |
235 | { | 233 | { |
236 | int addr_cells; | 234 | int addr_cells; |
237 | unsigned int *buid_vals; | 235 | const unsigned int *buid_vals; |
238 | unsigned int len; | 236 | unsigned int len; |
239 | unsigned long buid; | 237 | unsigned long buid; |
240 | 238 | ||
@@ -247,7 +245,7 @@ unsigned long __devinit get_phb_buid (struct device_node *phb) | |||
247 | if (phb->parent->parent) | 245 | if (phb->parent->parent) |
248 | return 0; | 246 | return 0; |
249 | 247 | ||
250 | buid_vals = (unsigned int *) get_property(phb, "reg", &len); | 248 | buid_vals = get_property(phb, "reg", &len); |
251 | if (buid_vals == NULL) | 249 | if (buid_vals == NULL) |
252 | return 0; | 250 | return 0; |
253 | 251 | ||
@@ -264,10 +262,10 @@ unsigned long __devinit get_phb_buid (struct device_node *phb) | |||
264 | static int phb_set_bus_ranges(struct device_node *dev, | 262 | static int phb_set_bus_ranges(struct device_node *dev, |
265 | struct pci_controller *phb) | 263 | struct pci_controller *phb) |
266 | { | 264 | { |
267 | int *bus_range; | 265 | const int *bus_range; |
268 | unsigned int len; | 266 | unsigned int len; |
269 | 267 | ||
270 | bus_range = (int *) get_property(dev, "bus-range", &len); | 268 | bus_range = get_property(dev, "bus-range", &len); |
271 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 269 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
272 | return 1; | 270 | return 1; |
273 | } | 271 | } |
@@ -325,15 +323,15 @@ unsigned long __init find_and_init_phbs(void) | |||
325 | * in chosen. | 323 | * in chosen. |
326 | */ | 324 | */ |
327 | if (of_chosen) { | 325 | if (of_chosen) { |
328 | int *prop; | 326 | const int *prop; |
329 | 327 | ||
330 | prop = (int *)get_property(of_chosen, "linux,pci-probe-only", | 328 | prop = get_property(of_chosen, |
331 | NULL); | 329 | "linux,pci-probe-only", NULL); |
332 | if (prop) | 330 | if (prop) |
333 | pci_probe_only = *prop; | 331 | pci_probe_only = *prop; |
334 | 332 | ||
335 | prop = (int *)get_property(of_chosen, | 333 | prop = get_property(of_chosen, |
336 | "linux,pci-assign-all-buses", NULL); | 334 | "linux,pci-assign-all-buses", NULL); |
337 | if (prop) | 335 | if (prop) |
338 | pci_assign_all_buses = *prop; | 336 | pci_assign_all_buses = *prop; |
339 | } | 337 | } |