aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r--arch/powerpc/kernel/pci_64.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 1d85fcba51e4..e795a7e2a38e 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -246,10 +246,10 @@ static void __init pcibios_claim_of_setup(void)
246#ifdef CONFIG_PPC_MULTIPLATFORM 246#ifdef CONFIG_PPC_MULTIPLATFORM
247static u32 get_int_prop(struct device_node *np, const char *name, u32 def) 247static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
248{ 248{
249 u32 *prop; 249 const u32 *prop;
250 int len; 250 int len;
251 251
252 prop = (u32 *) get_property(np, name, &len); 252 prop = get_property(np, name, &len);
253 if (prop && len >= 4) 253 if (prop && len >= 4)
254 return *prop; 254 return *prop;
255 return def; 255 return def;
@@ -278,10 +278,11 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
278 u64 base, size; 278 u64 base, size;
279 unsigned int flags; 279 unsigned int flags;
280 struct resource *res; 280 struct resource *res;
281 u32 *addrs, i; 281 const u32 *addrs;
282 u32 i;
282 int proplen; 283 int proplen;
283 284
284 addrs = (u32 *) get_property(node, "assigned-addresses", &proplen); 285 addrs = get_property(node, "assigned-addresses", &proplen);
285 if (!addrs) 286 if (!addrs)
286 return; 287 return;
287 DBG(" parse addresses (%d bytes) @ %p\n", proplen, addrs); 288 DBG(" parse addresses (%d bytes) @ %p\n", proplen, addrs);
@@ -381,7 +382,7 @@ void __devinit of_scan_bus(struct device_node *node,
381 struct pci_bus *bus) 382 struct pci_bus *bus)
382{ 383{
383 struct device_node *child = NULL; 384 struct device_node *child = NULL;
384 u32 *reg; 385 const u32 *reg;
385 int reglen, devfn; 386 int reglen, devfn;
386 struct pci_dev *dev; 387 struct pci_dev *dev;
387 388
@@ -389,7 +390,7 @@ void __devinit of_scan_bus(struct device_node *node,
389 390
390 while ((child = of_get_next_child(node, child)) != NULL) { 391 while ((child = of_get_next_child(node, child)) != NULL) {
391 DBG(" * %s\n", child->full_name); 392 DBG(" * %s\n", child->full_name);
392 reg = (u32 *) get_property(child, "reg", &reglen); 393 reg = get_property(child, "reg", &reglen);
393 if (reg == NULL || reglen < 20) 394 if (reg == NULL || reglen < 20)
394 continue; 395 continue;
395 devfn = (reg[0] >> 8) & 0xff; 396 devfn = (reg[0] >> 8) & 0xff;
@@ -413,7 +414,7 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
413 struct pci_dev *dev) 414 struct pci_dev *dev)
414{ 415{
415 struct pci_bus *bus; 416 struct pci_bus *bus;
416 u32 *busrange, *ranges; 417 const u32 *busrange, *ranges;
417 int len, i, mode; 418 int len, i, mode;
418 struct resource *res; 419 struct resource *res;
419 unsigned int flags; 420 unsigned int flags;
@@ -422,13 +423,13 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
422 DBG("of_scan_pci_bridge(%s)\n", node->full_name); 423 DBG("of_scan_pci_bridge(%s)\n", node->full_name);
423 424
424 /* parse bus-range property */ 425 /* parse bus-range property */
425 busrange = (u32 *) get_property(node, "bus-range", &len); 426 busrange = get_property(node, "bus-range", &len);
426 if (busrange == NULL || len != 8) { 427 if (busrange == NULL || len != 8) {
427 printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n", 428 printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n",
428 node->full_name); 429 node->full_name);
429 return; 430 return;
430 } 431 }
431 ranges = (u32 *) get_property(node, "ranges", &len); 432 ranges = get_property(node, "ranges", &len);
432 if (ranges == NULL) { 433 if (ranges == NULL) {
433 printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n", 434 printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n",
434 node->full_name); 435 node->full_name);
@@ -892,13 +893,13 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
892 unsigned int size; 893 unsigned int size;
893 }; 894 };
894 895
895 struct isa_range *range; 896 const struct isa_range *range;
896 unsigned long pci_addr; 897 unsigned long pci_addr;
897 unsigned int isa_addr; 898 unsigned int isa_addr;
898 unsigned int size; 899 unsigned int size;
899 int rlen = 0; 900 int rlen = 0;
900 901
901 range = (struct isa_range *) get_property(isa_node, "ranges", &rlen); 902 range = get_property(isa_node, "ranges", &rlen);
902 if (range == NULL || (rlen < sizeof(struct isa_range))) { 903 if (range == NULL || (rlen < sizeof(struct isa_range))) {
903 printk(KERN_ERR "no ISA ranges or unexpected isa range size," 904 printk(KERN_ERR "no ISA ranges or unexpected isa range size,"
904 "mapping 64k\n"); 905 "mapping 64k\n");
@@ -939,7 +940,8 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
939void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose, 940void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
940 struct device_node *dev, int prim) 941 struct device_node *dev, int prim)
941{ 942{
942 unsigned int *ranges, pci_space; 943 const unsigned int *ranges;
944 unsigned int pci_space;
943 unsigned long size; 945 unsigned long size;
944 int rlen = 0; 946 int rlen = 0;
945 int memno = 0; 947 int memno = 0;
@@ -957,7 +959,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
957 * (size depending on dev->n_addr_cells) 959 * (size depending on dev->n_addr_cells)
958 * cells 4+5 or 5+6: the size of the range 960 * cells 4+5 or 5+6: the size of the range
959 */ 961 */
960 ranges = (unsigned int *) get_property(dev, "ranges", &rlen); 962 ranges = get_property(dev, "ranges", &rlen);
961 if (ranges == NULL) 963 if (ranges == NULL)
962 return; 964 return;
963 hose->io_base_phys = 0; 965 hose->io_base_phys = 0;