diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2006-07-12 01:40:29 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 01:55:05 -0400 |
commit | 018a3d1db7cdb6127656c1622ee1d2302e16436d (patch) | |
tree | 5b6714fa9fcd1441f7c1b30e0391484c095925b6 /arch | |
parent | eeb2b723ef5100fafa381d92eb70d83e98516a44 (diff) |
[POWERPC] powermac: Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.
powermac platform & macintosh driver changes.
Built for pmac32_defconfig, g5_defconfig
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/powermac/backlight.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/cpufreq_32.c | 23 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/cpufreq_64.c | 27 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/feature.c | 30 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/low_i2c.c | 24 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pci.c | 37 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pfunc_base.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pfunc_core.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/smp.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/udbg_scc.c | 10 |
11 files changed, 95 insertions, 91 deletions
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c index 69f65e215a5c..205b4a392862 100644 --- a/arch/powerpc/platforms/powermac/backlight.c +++ b/arch/powerpc/platforms/powermac/backlight.c | |||
@@ -38,7 +38,8 @@ int pmac_has_backlight_type(const char *type) | |||
38 | struct device_node* bk_node = find_devices("backlight"); | 38 | struct device_node* bk_node = find_devices("backlight"); |
39 | 39 | ||
40 | if (bk_node) { | 40 | if (bk_node) { |
41 | char *prop = get_property(bk_node, "backlight-control", NULL); | 41 | const char *prop = get_property(bk_node, |
42 | "backlight-control", NULL); | ||
42 | if (prop && strncmp(prop, type, strlen(type)) == 0) | 43 | if (prop && strncmp(prop, type, strlen(type)) == 0) |
43 | return 1; | 44 | return 1; |
44 | } | 45 | } |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c index 62926248bdb8..c2b6b4134f68 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c | |||
@@ -421,7 +421,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
421 | 421 | ||
422 | static u32 read_gpio(struct device_node *np) | 422 | static u32 read_gpio(struct device_node *np) |
423 | { | 423 | { |
424 | u32 *reg = (u32 *)get_property(np, "reg", NULL); | 424 | const u32 *reg = get_property(np, "reg", NULL); |
425 | u32 offset; | 425 | u32 offset; |
426 | 426 | ||
427 | if (reg == NULL) | 427 | if (reg == NULL) |
@@ -497,7 +497,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
497 | "frequency-gpio"); | 497 | "frequency-gpio"); |
498 | struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL, | 498 | struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL, |
499 | "slewing-done"); | 499 | "slewing-done"); |
500 | u32 *value; | 500 | const u32 *value; |
501 | 501 | ||
502 | /* | 502 | /* |
503 | * Check to see if it's GPIO driven or PMU only | 503 | * Check to see if it's GPIO driven or PMU only |
@@ -519,15 +519,15 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
519 | */ | 519 | */ |
520 | if (frequency_gpio && slew_done_gpio) { | 520 | if (frequency_gpio && slew_done_gpio) { |
521 | int lenp, rc; | 521 | int lenp, rc; |
522 | u32 *freqs, *ratio; | 522 | const u32 *freqs, *ratio; |
523 | 523 | ||
524 | freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp); | 524 | freqs = get_property(cpunode, "bus-frequencies", &lenp); |
525 | lenp /= sizeof(u32); | 525 | lenp /= sizeof(u32); |
526 | if (freqs == NULL || lenp != 2) { | 526 | if (freqs == NULL || lenp != 2) { |
527 | printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); | 527 | printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); |
528 | return 1; | 528 | return 1; |
529 | } | 529 | } |
530 | ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL); | 530 | ratio = get_property(cpunode, "processor-to-bus-ratio*2", NULL); |
531 | if (ratio == NULL) { | 531 | if (ratio == NULL) { |
532 | printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); | 532 | printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); |
533 | return 1; | 533 | return 1; |
@@ -562,7 +562,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
562 | /* If we use the PMU, look for the min & max frequencies in the | 562 | /* If we use the PMU, look for the min & max frequencies in the |
563 | * device-tree | 563 | * device-tree |
564 | */ | 564 | */ |
565 | value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL); | 565 | value = get_property(cpunode, "min-clock-frequency", NULL); |
566 | if (!value) | 566 | if (!value) |
567 | return 1; | 567 | return 1; |
568 | low_freq = (*value) / 1000; | 568 | low_freq = (*value) / 1000; |
@@ -571,7 +571,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) | |||
571 | if (low_freq < 100000) | 571 | if (low_freq < 100000) |
572 | low_freq *= 10; | 572 | low_freq *= 10; |
573 | 573 | ||
574 | value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL); | 574 | value = get_property(cpunode, "max-clock-frequency", NULL); |
575 | if (!value) | 575 | if (!value) |
576 | return 1; | 576 | return 1; |
577 | hi_freq = (*value) / 1000; | 577 | hi_freq = (*value) / 1000; |
@@ -611,13 +611,14 @@ static int pmac_cpufreq_init_7447A(struct device_node *cpunode) | |||
611 | static int pmac_cpufreq_init_750FX(struct device_node *cpunode) | 611 | static int pmac_cpufreq_init_750FX(struct device_node *cpunode) |
612 | { | 612 | { |
613 | struct device_node *volt_gpio_np; | 613 | struct device_node *volt_gpio_np; |
614 | u32 pvr, *value; | 614 | u32 pvr; |
615 | const u32 *value; | ||
615 | 616 | ||
616 | if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) | 617 | if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) |
617 | return 1; | 618 | return 1; |
618 | 619 | ||
619 | hi_freq = cur_freq; | 620 | hi_freq = cur_freq; |
620 | value = (u32 *)get_property(cpunode, "reduced-clock-frequency", NULL); | 621 | value = get_property(cpunode, "reduced-clock-frequency", NULL); |
621 | if (!value) | 622 | if (!value) |
622 | return 1; | 623 | return 1; |
623 | low_freq = (*value) / 1000; | 624 | low_freq = (*value) / 1000; |
@@ -650,7 +651,7 @@ static int pmac_cpufreq_init_750FX(struct device_node *cpunode) | |||
650 | static int __init pmac_cpufreq_setup(void) | 651 | static int __init pmac_cpufreq_setup(void) |
651 | { | 652 | { |
652 | struct device_node *cpunode; | 653 | struct device_node *cpunode; |
653 | u32 *value; | 654 | const u32 *value; |
654 | 655 | ||
655 | if (strstr(cmd_line, "nocpufreq")) | 656 | if (strstr(cmd_line, "nocpufreq")) |
656 | return 0; | 657 | return 0; |
@@ -661,7 +662,7 @@ static int __init pmac_cpufreq_setup(void) | |||
661 | goto out; | 662 | goto out; |
662 | 663 | ||
663 | /* Get current cpu clock freq */ | 664 | /* Get current cpu clock freq */ |
664 | value = (u32 *)get_property(cpunode, "clock-frequency", NULL); | 665 | value = get_property(cpunode, "clock-frequency", NULL); |
665 | if (!value) | 666 | if (!value) |
666 | goto out; | 667 | goto out; |
667 | cur_freq = (*value) / 1000; | 668 | cur_freq = (*value) / 1000; |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c index a6a84ac5433e..c364c89adb4e 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_64.c +++ b/arch/powerpc/platforms/powermac/cpufreq_64.c | |||
@@ -89,7 +89,7 @@ static DEFINE_MUTEX(g5_switch_mutex); | |||
89 | 89 | ||
90 | #ifdef CONFIG_PPC_SMU | 90 | #ifdef CONFIG_PPC_SMU |
91 | 91 | ||
92 | static u32 *g5_pmode_data; | 92 | static const u32 *g5_pmode_data; |
93 | static int g5_pmode_max; | 93 | static int g5_pmode_max; |
94 | 94 | ||
95 | static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */ | 95 | static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */ |
@@ -391,7 +391,8 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
391 | unsigned int psize, ssize; | 391 | unsigned int psize, ssize; |
392 | unsigned long max_freq; | 392 | unsigned long max_freq; |
393 | char *freq_method, *volt_method; | 393 | char *freq_method, *volt_method; |
394 | u32 *valp, pvr_hi; | 394 | const u32 *valp; |
395 | u32 pvr_hi; | ||
395 | int use_volts_vdnap = 0; | 396 | int use_volts_vdnap = 0; |
396 | int use_volts_smu = 0; | 397 | int use_volts_smu = 0; |
397 | int rc = -ENODEV; | 398 | int rc = -ENODEV; |
@@ -409,8 +410,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
409 | /* Get first CPU node */ | 410 | /* Get first CPU node */ |
410 | for (cpunode = NULL; | 411 | for (cpunode = NULL; |
411 | (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { | 412 | (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { |
412 | u32 *reg = | 413 | const u32 *reg = get_property(cpunode, "reg", NULL); |
413 | (u32 *)get_property(cpunode, "reg", NULL); | ||
414 | if (reg == NULL || (*reg) != 0) | 414 | if (reg == NULL || (*reg) != 0) |
415 | continue; | 415 | continue; |
416 | if (!strcmp(cpunode->type, "cpu")) | 416 | if (!strcmp(cpunode->type, "cpu")) |
@@ -422,7 +422,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
422 | } | 422 | } |
423 | 423 | ||
424 | /* Check 970FX for now */ | 424 | /* Check 970FX for now */ |
425 | valp = (u32 *)get_property(cpunode, "cpu-version", NULL); | 425 | valp = get_property(cpunode, "cpu-version", NULL); |
426 | if (!valp) { | 426 | if (!valp) { |
427 | DBG("No cpu-version property !\n"); | 427 | DBG("No cpu-version property !\n"); |
428 | goto bail_noprops; | 428 | goto bail_noprops; |
@@ -434,7 +434,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
434 | } | 434 | } |
435 | 435 | ||
436 | /* Look for the powertune data in the device-tree */ | 436 | /* Look for the powertune data in the device-tree */ |
437 | g5_pmode_data = (u32 *)get_property(cpunode, "power-mode-data",&psize); | 437 | g5_pmode_data = get_property(cpunode, "power-mode-data",&psize); |
438 | if (!g5_pmode_data) { | 438 | if (!g5_pmode_data) { |
439 | DBG("No power-mode-data !\n"); | 439 | DBG("No power-mode-data !\n"); |
440 | goto bail_noprops; | 440 | goto bail_noprops; |
@@ -442,7 +442,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
442 | g5_pmode_max = psize / sizeof(u32) - 1; | 442 | g5_pmode_max = psize / sizeof(u32) - 1; |
443 | 443 | ||
444 | if (use_volts_smu) { | 444 | if (use_volts_smu) { |
445 | struct smu_sdbp_header *shdr; | 445 | const struct smu_sdbp_header *shdr; |
446 | 446 | ||
447 | /* Look for the FVT table */ | 447 | /* Look for the FVT table */ |
448 | shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL); | 448 | shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL); |
@@ -493,7 +493,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
493 | * half freq in this version. So far, I haven't yet seen a machine | 493 | * half freq in this version. So far, I haven't yet seen a machine |
494 | * supporting anything else. | 494 | * supporting anything else. |
495 | */ | 495 | */ |
496 | valp = (u32 *)get_property(cpunode, "clock-frequency", NULL); | 496 | valp = get_property(cpunode, "clock-frequency", NULL); |
497 | if (!valp) | 497 | if (!valp) |
498 | return -ENODEV; | 498 | return -ENODEV; |
499 | max_freq = (*valp)/1000; | 499 | max_freq = (*valp)/1000; |
@@ -541,8 +541,8 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
541 | static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | 541 | static int __init g5_pm72_cpufreq_init(struct device_node *cpus) |
542 | { | 542 | { |
543 | struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL; | 543 | struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL; |
544 | u8 *eeprom = NULL; | 544 | const u8 *eeprom = NULL; |
545 | u32 *valp; | 545 | const u32 *valp; |
546 | u64 max_freq, min_freq, ih, il; | 546 | u64 max_freq, min_freq, ih, il; |
547 | int has_volt = 1, rc = 0; | 547 | int has_volt = 1, rc = 0; |
548 | 548 | ||
@@ -563,7 +563,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
563 | /* Lookup the cpuid eeprom node */ | 563 | /* Lookup the cpuid eeprom node */ |
564 | cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0"); | 564 | cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0"); |
565 | if (cpuid != NULL) | 565 | if (cpuid != NULL) |
566 | eeprom = (u8 *)get_property(cpuid, "cpuid", NULL); | 566 | eeprom = get_property(cpuid, "cpuid", NULL); |
567 | if (eeprom == NULL) { | 567 | if (eeprom == NULL) { |
568 | printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); | 568 | printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); |
569 | rc = -ENODEV; | 569 | rc = -ENODEV; |
@@ -573,7 +573,8 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
573 | /* Lookup the i2c hwclock */ | 573 | /* Lookup the i2c hwclock */ |
574 | for (hwclock = NULL; | 574 | for (hwclock = NULL; |
575 | (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ | 575 | (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ |
576 | char *loc = get_property(hwclock, "hwctrl-location", NULL); | 576 | const char *loc = get_property(hwclock, |
577 | "hwctrl-location", NULL); | ||
577 | if (loc == NULL) | 578 | if (loc == NULL) |
578 | continue; | 579 | continue; |
579 | if (strcmp(loc, "CPU CLOCK")) | 580 | if (strcmp(loc, "CPU CLOCK")) |
@@ -637,7 +638,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) | |||
637 | */ | 638 | */ |
638 | 639 | ||
639 | /* Get max frequency from device-tree */ | 640 | /* Get max frequency from device-tree */ |
640 | valp = (u32 *)get_property(cpunode, "clock-frequency", NULL); | 641 | valp = get_property(cpunode, "clock-frequency", NULL); |
641 | if (!valp) { | 642 | if (!valp) { |
642 | printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); | 643 | printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); |
643 | rc = -ENODEV; | 644 | rc = -ENODEV; |
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index f8313bf9a9f7..13fcaf5b1796 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -1058,8 +1058,8 @@ core99_reset_cpu(struct device_node *node, long param, long value) | |||
1058 | if (np == NULL) | 1058 | if (np == NULL) |
1059 | return -ENODEV; | 1059 | return -ENODEV; |
1060 | for (np = np->child; np != NULL; np = np->sibling) { | 1060 | for (np = np->child; np != NULL; np = np->sibling) { |
1061 | u32 *num = (u32 *)get_property(np, "reg", NULL); | 1061 | u32 *num = get_property(np, "reg", NULL); |
1062 | u32 *rst = (u32 *)get_property(np, "soft-reset", NULL); | 1062 | u32 *rst = get_property(np, "soft-reset", NULL); |
1063 | if (num == NULL || rst == NULL) | 1063 | if (num == NULL || rst == NULL) |
1064 | continue; | 1064 | continue; |
1065 | if (param == *num) { | 1065 | if (param == *num) { |
@@ -1087,7 +1087,7 @@ core99_usb_enable(struct device_node *node, long param, long value) | |||
1087 | { | 1087 | { |
1088 | struct macio_chip *macio; | 1088 | struct macio_chip *macio; |
1089 | unsigned long flags; | 1089 | unsigned long flags; |
1090 | char *prop; | 1090 | const char *prop; |
1091 | int number; | 1091 | int number; |
1092 | u32 reg; | 1092 | u32 reg; |
1093 | 1093 | ||
@@ -1096,7 +1096,7 @@ core99_usb_enable(struct device_node *node, long param, long value) | |||
1096 | macio->type != macio_intrepid) | 1096 | macio->type != macio_intrepid) |
1097 | return -ENODEV; | 1097 | return -ENODEV; |
1098 | 1098 | ||
1099 | prop = (char *)get_property(node, "AAPL,clock-id", NULL); | 1099 | prop = get_property(node, "AAPL,clock-id", NULL); |
1100 | if (!prop) | 1100 | if (!prop) |
1101 | return -ENODEV; | 1101 | return -ENODEV; |
1102 | if (strncmp(prop, "usb0u048", 8) == 0) | 1102 | if (strncmp(prop, "usb0u048", 8) == 0) |
@@ -1507,8 +1507,8 @@ static long g5_reset_cpu(struct device_node *node, long param, long value) | |||
1507 | if (np == NULL) | 1507 | if (np == NULL) |
1508 | return -ENODEV; | 1508 | return -ENODEV; |
1509 | for (np = np->child; np != NULL; np = np->sibling) { | 1509 | for (np = np->child; np != NULL; np = np->sibling) { |
1510 | u32 *num = (u32 *)get_property(np, "reg", NULL); | 1510 | const u32 *num = get_property(np, "reg", NULL); |
1511 | u32 *rst = (u32 *)get_property(np, "soft-reset", NULL); | 1511 | const u32 *rst = get_property(np, "soft-reset", NULL); |
1512 | if (num == NULL || rst == NULL) | 1512 | if (num == NULL || rst == NULL) |
1513 | continue; | 1513 | continue; |
1514 | if (param == *num) { | 1514 | if (param == *num) { |
@@ -2408,7 +2408,7 @@ static int __init probe_motherboard(void) | |||
2408 | */ | 2408 | */ |
2409 | dt = find_devices("device-tree"); | 2409 | dt = find_devices("device-tree"); |
2410 | if (dt != NULL) | 2410 | if (dt != NULL) |
2411 | model = (const char *) get_property(dt, "model", NULL); | 2411 | model = get_property(dt, "model", NULL); |
2412 | for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { | 2412 | for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { |
2413 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { | 2413 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { |
2414 | pmac_mb = pmac_mb_defs[i]; | 2414 | pmac_mb = pmac_mb_defs[i]; |
@@ -2536,7 +2536,7 @@ found: | |||
2536 | */ | 2536 | */ |
2537 | static void __init probe_uninorth(void) | 2537 | static void __init probe_uninorth(void) |
2538 | { | 2538 | { |
2539 | u32 *addrp; | 2539 | const u32 *addrp; |
2540 | phys_addr_t address; | 2540 | phys_addr_t address; |
2541 | unsigned long actrl; | 2541 | unsigned long actrl; |
2542 | 2542 | ||
@@ -2555,7 +2555,7 @@ static void __init probe_uninorth(void) | |||
2555 | if (uninorth_node == NULL) | 2555 | if (uninorth_node == NULL) |
2556 | return; | 2556 | return; |
2557 | 2557 | ||
2558 | addrp = (u32 *)get_property(uninorth_node, "reg", NULL); | 2558 | addrp = get_property(uninorth_node, "reg", NULL); |
2559 | if (addrp == NULL) | 2559 | if (addrp == NULL) |
2560 | return; | 2560 | return; |
2561 | address = of_translate_address(uninorth_node, addrp); | 2561 | address = of_translate_address(uninorth_node, addrp); |
@@ -2596,7 +2596,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2596 | struct device_node* node; | 2596 | struct device_node* node; |
2597 | int i; | 2597 | int i; |
2598 | volatile u32 __iomem *base; | 2598 | volatile u32 __iomem *base; |
2599 | u32 *addrp, *revp; | 2599 | const u32 *addrp, *revp; |
2600 | phys_addr_t addr; | 2600 | phys_addr_t addr; |
2601 | u64 size; | 2601 | u64 size; |
2602 | 2602 | ||
@@ -2639,7 +2639,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2639 | return; | 2639 | return; |
2640 | } | 2640 | } |
2641 | if (type == macio_keylargo || type == macio_keylargo2) { | 2641 | if (type == macio_keylargo || type == macio_keylargo2) { |
2642 | u32 *did = (u32 *)get_property(node, "device-id", NULL); | 2642 | const u32 *did = get_property(node, "device-id", NULL); |
2643 | if (*did == 0x00000025) | 2643 | if (*did == 0x00000025) |
2644 | type = macio_pangea; | 2644 | type = macio_pangea; |
2645 | if (*did == 0x0000003e) | 2645 | if (*did == 0x0000003e) |
@@ -2652,7 +2652,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ | |||
2652 | macio_chips[i].base = base; | 2652 | macio_chips[i].base = base; |
2653 | macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON; | 2653 | macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON; |
2654 | macio_chips[i].name = macio_names[type]; | 2654 | macio_chips[i].name = macio_names[type]; |
2655 | revp = (u32 *)get_property(node, "revision-id", NULL); | 2655 | revp = get_property(node, "revision-id", NULL); |
2656 | if (revp) | 2656 | if (revp) |
2657 | macio_chips[i].rev = *revp; | 2657 | macio_chips[i].rev = *revp; |
2658 | printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", | 2658 | printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", |
@@ -2695,15 +2695,15 @@ static void __init | |||
2695 | initial_serial_shutdown(struct device_node *np) | 2695 | initial_serial_shutdown(struct device_node *np) |
2696 | { | 2696 | { |
2697 | int len; | 2697 | int len; |
2698 | struct slot_names_prop { | 2698 | const struct slot_names_prop { |
2699 | int count; | 2699 | int count; |
2700 | char name[1]; | 2700 | char name[1]; |
2701 | } *slots; | 2701 | } *slots; |
2702 | char *conn; | 2702 | const char *conn; |
2703 | int port_type = PMAC_SCC_ASYNC; | 2703 | int port_type = PMAC_SCC_ASYNC; |
2704 | int modem = 0; | 2704 | int modem = 0; |
2705 | 2705 | ||
2706 | slots = (struct slot_names_prop *)get_property(np, "slot-names", &len); | 2706 | slots = get_property(np, "slot-names", &len); |
2707 | conn = get_property(np, "AAPL,connector", &len); | 2707 | conn = get_property(np, "AAPL,connector", &len); |
2708 | if (conn && (strcmp(conn, "infrared") == 0)) | 2708 | if (conn && (strcmp(conn, "infrared") == 0)) |
2709 | port_type = PMAC_SCC_IRDA; | 2709 | port_type = PMAC_SCC_IRDA; |
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index 8677f50c2586..c2c7cf75dd5f 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c | |||
@@ -477,7 +477,8 @@ static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, | |||
477 | static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | 477 | static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) |
478 | { | 478 | { |
479 | struct pmac_i2c_host_kw *host; | 479 | struct pmac_i2c_host_kw *host; |
480 | u32 *psteps, *prate, *addrp, steps; | 480 | const u32 *psteps, *prate, *addrp; |
481 | u32 steps; | ||
481 | 482 | ||
482 | host = kzalloc(sizeof(struct pmac_i2c_host_kw), GFP_KERNEL); | 483 | host = kzalloc(sizeof(struct pmac_i2c_host_kw), GFP_KERNEL); |
483 | if (host == NULL) { | 484 | if (host == NULL) { |
@@ -490,7 +491,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | |||
490 | * on all i2c keywest nodes so far ... we would have to fallback | 491 | * on all i2c keywest nodes so far ... we would have to fallback |
491 | * to macio parsing if that wasn't the case | 492 | * to macio parsing if that wasn't the case |
492 | */ | 493 | */ |
493 | addrp = (u32 *)get_property(np, "AAPL,address", NULL); | 494 | addrp = get_property(np, "AAPL,address", NULL); |
494 | if (addrp == NULL) { | 495 | if (addrp == NULL) { |
495 | printk(KERN_ERR "low_i2c: Can't find address for %s\n", | 496 | printk(KERN_ERR "low_i2c: Can't find address for %s\n", |
496 | np->full_name); | 497 | np->full_name); |
@@ -504,13 +505,13 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) | |||
504 | host->timeout_timer.function = kw_i2c_timeout; | 505 | host->timeout_timer.function = kw_i2c_timeout; |
505 | host->timeout_timer.data = (unsigned long)host; | 506 | host->timeout_timer.data = (unsigned long)host; |
506 | 507 | ||
507 | psteps = (u32 *)get_property(np, "AAPL,address-step", NULL); | 508 | psteps = get_property(np, "AAPL,address-step", NULL); |
508 | steps = psteps ? (*psteps) : 0x10; | 509 | steps = psteps ? (*psteps) : 0x10; |
509 | for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) | 510 | for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) |
510 | steps >>= 1; | 511 | steps >>= 1; |
511 | /* Select interface rate */ | 512 | /* Select interface rate */ |
512 | host->speed = KW_I2C_MODE_25KHZ; | 513 | host->speed = KW_I2C_MODE_25KHZ; |
513 | prate = (u32 *)get_property(np, "AAPL,i2c-rate", NULL); | 514 | prate = get_property(np, "AAPL,i2c-rate", NULL); |
514 | if (prate) switch(*prate) { | 515 | if (prate) switch(*prate) { |
515 | case 100: | 516 | case 100: |
516 | host->speed = KW_I2C_MODE_100KHZ; | 517 | host->speed = KW_I2C_MODE_100KHZ; |
@@ -618,8 +619,8 @@ static void __init kw_i2c_probe(void) | |||
618 | } else { | 619 | } else { |
619 | for (child = NULL; | 620 | for (child = NULL; |
620 | (child = of_get_next_child(np, child)) != NULL;) { | 621 | (child = of_get_next_child(np, child)) != NULL;) { |
621 | u32 *reg = | 622 | const u32 *reg = get_property(child, |
622 | (u32 *)get_property(child, "reg", NULL); | 623 | "reg", NULL); |
623 | if (reg == NULL) | 624 | if (reg == NULL) |
624 | continue; | 625 | continue; |
625 | kw_i2c_add(host, np, child, *reg); | 626 | kw_i2c_add(host, np, child, *reg); |
@@ -881,7 +882,7 @@ static void __init smu_i2c_probe(void) | |||
881 | { | 882 | { |
882 | struct device_node *controller, *busnode; | 883 | struct device_node *controller, *busnode; |
883 | struct pmac_i2c_bus *bus; | 884 | struct pmac_i2c_bus *bus; |
884 | u32 *reg; | 885 | const u32 *reg; |
885 | int sz; | 886 | int sz; |
886 | 887 | ||
887 | if (!smu_present()) | 888 | if (!smu_present()) |
@@ -904,7 +905,7 @@ static void __init smu_i2c_probe(void) | |||
904 | if (strcmp(busnode->type, "i2c") && | 905 | if (strcmp(busnode->type, "i2c") && |
905 | strcmp(busnode->type, "i2c-bus")) | 906 | strcmp(busnode->type, "i2c-bus")) |
906 | continue; | 907 | continue; |
907 | reg = (u32 *)get_property(busnode, "reg", NULL); | 908 | reg = get_property(busnode, "reg", NULL); |
908 | if (reg == NULL) | 909 | if (reg == NULL) |
909 | continue; | 910 | continue; |
910 | 911 | ||
@@ -948,9 +949,8 @@ struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node) | |||
948 | list_for_each_entry(bus, &pmac_i2c_busses, link) { | 949 | list_for_each_entry(bus, &pmac_i2c_busses, link) { |
949 | if (p == bus->busnode) { | 950 | if (p == bus->busnode) { |
950 | if (prev && bus->flags & pmac_i2c_multibus) { | 951 | if (prev && bus->flags & pmac_i2c_multibus) { |
951 | u32 *reg; | 952 | const u32 *reg; |
952 | reg = (u32 *)get_property(prev, "reg", | 953 | reg = get_property(prev, "reg", NULL); |
953 | NULL); | ||
954 | if (!reg) | 954 | if (!reg) |
955 | continue; | 955 | continue; |
956 | if (((*reg) >> 8) != bus->channel) | 956 | if (((*reg) >> 8) != bus->channel) |
@@ -971,7 +971,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_find_bus); | |||
971 | 971 | ||
972 | u8 pmac_i2c_get_dev_addr(struct device_node *device) | 972 | u8 pmac_i2c_get_dev_addr(struct device_node *device) |
973 | { | 973 | { |
974 | u32 *reg = (u32 *)get_property(device, "reg", NULL); | 974 | const u32 *reg = get_property(device, "reg", NULL); |
975 | 975 | ||
976 | if (reg == NULL) | 976 | if (reg == NULL) |
977 | return 0; | 977 | return 0; |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 556b349797e8..787ffd999bc2 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -69,16 +69,16 @@ struct device_node *k2_skiplist[2]; | |||
69 | static int __init fixup_one_level_bus_range(struct device_node *node, int higher) | 69 | static int __init fixup_one_level_bus_range(struct device_node *node, int higher) |
70 | { | 70 | { |
71 | for (; node != 0;node = node->sibling) { | 71 | for (; node != 0;node = node->sibling) { |
72 | int * bus_range; | 72 | const int * bus_range; |
73 | unsigned int *class_code; | 73 | const unsigned int *class_code; |
74 | int len; | 74 | int len; |
75 | 75 | ||
76 | /* For PCI<->PCI bridges or CardBus bridges, we go down */ | 76 | /* For PCI<->PCI bridges or CardBus bridges, we go down */ |
77 | class_code = (unsigned int *) get_property(node, "class-code", NULL); | 77 | class_code = get_property(node, "class-code", NULL); |
78 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && | 78 | if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && |
79 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) | 79 | (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) |
80 | continue; | 80 | continue; |
81 | bus_range = (int *) get_property(node, "bus-range", &len); | 81 | bus_range = get_property(node, "bus-range", &len); |
82 | if (bus_range != NULL && len > 2 * sizeof(int)) { | 82 | if (bus_range != NULL && len > 2 * sizeof(int)) { |
83 | if (bus_range[1] > higher) | 83 | if (bus_range[1] > higher) |
84 | higher = bus_range[1]; | 84 | higher = bus_range[1]; |
@@ -96,13 +96,15 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher | |||
96 | */ | 96 | */ |
97 | static void __init fixup_bus_range(struct device_node *bridge) | 97 | static void __init fixup_bus_range(struct device_node *bridge) |
98 | { | 98 | { |
99 | int * bus_range; | 99 | int *bus_range, len; |
100 | int len; | 100 | struct property *prop; |
101 | 101 | ||
102 | /* Lookup the "bus-range" property for the hose */ | 102 | /* Lookup the "bus-range" property for the hose */ |
103 | bus_range = (int *) get_property(bridge, "bus-range", &len); | 103 | prop = of_find_property(bridge, "bus-range", &len); |
104 | if (bus_range == NULL || len < 2 * sizeof(int)) | 104 | if (prop == NULL || prop->length < 2 * sizeof(int)) |
105 | return; | 105 | return; |
106 | |||
107 | bus_range = (int *)prop->value; | ||
106 | bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]); | 108 | bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]); |
107 | } | 109 | } |
108 | 110 | ||
@@ -240,7 +242,7 @@ static struct pci_ops macrisc_pci_ops = | |||
240 | static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset) | 242 | static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset) |
241 | { | 243 | { |
242 | struct device_node *np; | 244 | struct device_node *np; |
243 | u32 *vendor, *device; | 245 | const u32 *vendor, *device; |
244 | 246 | ||
245 | if (offset >= 0x100) | 247 | if (offset >= 0x100) |
246 | return PCIBIOS_BAD_REGISTER_NUMBER; | 248 | return PCIBIOS_BAD_REGISTER_NUMBER; |
@@ -248,8 +250,8 @@ static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset) | |||
248 | if (np == NULL) | 250 | if (np == NULL) |
249 | return PCIBIOS_DEVICE_NOT_FOUND; | 251 | return PCIBIOS_DEVICE_NOT_FOUND; |
250 | 252 | ||
251 | vendor = (u32 *)get_property(np, "vendor-id", NULL); | 253 | vendor = get_property(np, "vendor-id", NULL); |
252 | device = (u32 *)get_property(np, "device-id", NULL); | 254 | device = get_property(np, "device-id", NULL); |
253 | if (vendor == NULL || device == NULL) | 255 | if (vendor == NULL || device == NULL) |
254 | return PCIBIOS_DEVICE_NOT_FOUND; | 256 | return PCIBIOS_DEVICE_NOT_FOUND; |
255 | 257 | ||
@@ -689,20 +691,21 @@ static void __init fixup_nec_usb2(void) | |||
689 | 691 | ||
690 | for (nec = NULL; (nec = of_find_node_by_name(nec, "usb")) != NULL;) { | 692 | for (nec = NULL; (nec = of_find_node_by_name(nec, "usb")) != NULL;) { |
691 | struct pci_controller *hose; | 693 | struct pci_controller *hose; |
692 | u32 data, *prop; | 694 | u32 data; |
695 | const u32 *prop; | ||
693 | u8 bus, devfn; | 696 | u8 bus, devfn; |
694 | 697 | ||
695 | prop = (u32 *)get_property(nec, "vendor-id", NULL); | 698 | prop = get_property(nec, "vendor-id", NULL); |
696 | if (prop == NULL) | 699 | if (prop == NULL) |
697 | continue; | 700 | continue; |
698 | if (0x1033 != *prop) | 701 | if (0x1033 != *prop) |
699 | continue; | 702 | continue; |
700 | prop = (u32 *)get_property(nec, "device-id", NULL); | 703 | prop = get_property(nec, "device-id", NULL); |
701 | if (prop == NULL) | 704 | if (prop == NULL) |
702 | continue; | 705 | continue; |
703 | if (0x0035 != *prop) | 706 | if (0x0035 != *prop) |
704 | continue; | 707 | continue; |
705 | prop = (u32 *)get_property(nec, "reg", NULL); | 708 | prop = get_property(nec, "reg", NULL); |
706 | if (prop == NULL) | 709 | if (prop == NULL) |
707 | continue; | 710 | continue; |
708 | devfn = (prop[0] >> 8) & 0xff; | 711 | devfn = (prop[0] >> 8) & 0xff; |
@@ -901,7 +904,7 @@ static int __init add_bridge(struct device_node *dev) | |||
901 | struct pci_controller *hose; | 904 | struct pci_controller *hose; |
902 | struct resource rsrc; | 905 | struct resource rsrc; |
903 | char *disp_name; | 906 | char *disp_name; |
904 | int *bus_range; | 907 | const int *bus_range; |
905 | int primary = 1, has_address = 0; | 908 | int primary = 1, has_address = 0; |
906 | 909 | ||
907 | DBG("Adding PCI host bridge %s\n", dev->full_name); | 910 | DBG("Adding PCI host bridge %s\n", dev->full_name); |
@@ -910,7 +913,7 @@ static int __init add_bridge(struct device_node *dev) | |||
910 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); | 913 | has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); |
911 | 914 | ||
912 | /* Get bus range if any */ | 915 | /* Get bus range if any */ |
913 | bus_range = (int *) get_property(dev, "bus-range", &len); | 916 | bus_range = get_property(dev, "bus-range", &len); |
914 | if (bus_range == NULL || len < 2 * sizeof(int)) { | 917 | if (bus_range == NULL || len < 2 * sizeof(int)) { |
915 | printk(KERN_WARNING "Can't get bus-range for %s, assume" | 918 | printk(KERN_WARNING "Can't get bus-range for %s, assume" |
916 | " bus 0\n", dev->full_name); | 919 | " bus 0\n", dev->full_name); |
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c index 6d66359ec8c8..829dacec96e5 100644 --- a/arch/powerpc/platforms/powermac/pfunc_base.c +++ b/arch/powerpc/platforms/powermac/pfunc_base.c | |||
@@ -114,7 +114,7 @@ static void macio_gpio_init_one(struct macio_chip *macio) | |||
114 | * we just create them all | 114 | * we just create them all |
115 | */ | 115 | */ |
116 | for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { | 116 | for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { |
117 | u32 *reg = (u32 *)get_property(gp, "reg", NULL); | 117 | const u32 *reg = get_property(gp, "reg", NULL); |
118 | unsigned long offset; | 118 | unsigned long offset; |
119 | if (reg == NULL) | 119 | if (reg == NULL) |
120 | continue; | 120 | continue; |
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index b117adbf9571..7651f278615a 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c | |||
@@ -813,14 +813,15 @@ struct pmf_function *__pmf_find_function(struct device_node *target, | |||
813 | struct pmf_device *dev; | 813 | struct pmf_device *dev; |
814 | struct pmf_function *func, *result = NULL; | 814 | struct pmf_function *func, *result = NULL; |
815 | char fname[64]; | 815 | char fname[64]; |
816 | u32 *prop, ph; | 816 | const u32 *prop; |
817 | u32 ph; | ||
817 | 818 | ||
818 | /* | 819 | /* |
819 | * Look for a "platform-*" function reference. If we can't find | 820 | * Look for a "platform-*" function reference. If we can't find |
820 | * one, then we fallback to a direct call attempt | 821 | * one, then we fallback to a direct call attempt |
821 | */ | 822 | */ |
822 | snprintf(fname, 63, "platform-%s", name); | 823 | snprintf(fname, 63, "platform-%s", name); |
823 | prop = (u32 *)get_property(target, fname, NULL); | 824 | prop = get_property(target, fname, NULL); |
824 | if (prop == NULL) | 825 | if (prop == NULL) |
825 | goto find_it; | 826 | goto find_it; |
826 | ph = *prop; | 827 | ph = *prop; |
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 31a9da769fa2..824a618396ab 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -116,7 +116,7 @@ extern struct smp_ops_t core99_smp_ops; | |||
116 | static void pmac_show_cpuinfo(struct seq_file *m) | 116 | static void pmac_show_cpuinfo(struct seq_file *m) |
117 | { | 117 | { |
118 | struct device_node *np; | 118 | struct device_node *np; |
119 | char *pp; | 119 | const char *pp; |
120 | int plen; | 120 | int plen; |
121 | int mbmodel; | 121 | int mbmodel; |
122 | unsigned int mbflags; | 122 | unsigned int mbflags; |
@@ -134,12 +134,12 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
134 | seq_printf(m, "machine\t\t: "); | 134 | seq_printf(m, "machine\t\t: "); |
135 | np = of_find_node_by_path("/"); | 135 | np = of_find_node_by_path("/"); |
136 | if (np != NULL) { | 136 | if (np != NULL) { |
137 | pp = (char *) get_property(np, "model", NULL); | 137 | pp = get_property(np, "model", NULL); |
138 | if (pp != NULL) | 138 | if (pp != NULL) |
139 | seq_printf(m, "%s\n", pp); | 139 | seq_printf(m, "%s\n", pp); |
140 | else | 140 | else |
141 | seq_printf(m, "PowerMac\n"); | 141 | seq_printf(m, "PowerMac\n"); |
142 | pp = (char *) get_property(np, "compatible", &plen); | 142 | pp = get_property(np, "compatible", &plen); |
143 | if (pp != NULL) { | 143 | if (pp != NULL) { |
144 | seq_printf(m, "motherboard\t:"); | 144 | seq_printf(m, "motherboard\t:"); |
145 | while (plen > 0) { | 145 | while (plen > 0) { |
@@ -163,10 +163,8 @@ static void pmac_show_cpuinfo(struct seq_file *m) | |||
163 | if (np == NULL) | 163 | if (np == NULL) |
164 | np = of_find_node_by_type(NULL, "cache"); | 164 | np = of_find_node_by_type(NULL, "cache"); |
165 | if (np != NULL) { | 165 | if (np != NULL) { |
166 | unsigned int *ic = (unsigned int *) | 166 | const unsigned int *ic = get_property(np, "i-cache-size", NULL); |
167 | get_property(np, "i-cache-size", NULL); | 167 | const unsigned int *dc = get_property(np, "d-cache-size", NULL); |
168 | unsigned int *dc = (unsigned int *) | ||
169 | get_property(np, "d-cache-size", NULL); | ||
170 | seq_printf(m, "L2 cache\t:"); | 168 | seq_printf(m, "L2 cache\t:"); |
171 | has_l2cache = 1; | 169 | has_l2cache = 1; |
172 | if (get_property(np, "cache-unified", NULL) != 0 && dc) { | 170 | if (get_property(np, "cache-unified", NULL) != 0 && dc) { |
@@ -254,7 +252,7 @@ static void __init l2cr_init(void) | |||
254 | if (np == 0) | 252 | if (np == 0) |
255 | np = find_type_devices("cpu"); | 253 | np = find_type_devices("cpu"); |
256 | if (np != 0) { | 254 | if (np != 0) { |
257 | unsigned int *l2cr = (unsigned int *) | 255 | const unsigned int *l2cr = |
258 | get_property(np, "l2cr-value", NULL); | 256 | get_property(np, "l2cr-value", NULL); |
259 | if (l2cr != 0) { | 257 | if (l2cr != 0) { |
260 | ppc_override_l2cr = 1; | 258 | ppc_override_l2cr = 1; |
@@ -277,7 +275,7 @@ static void __init l2cr_init(void) | |||
277 | static void __init pmac_setup_arch(void) | 275 | static void __init pmac_setup_arch(void) |
278 | { | 276 | { |
279 | struct device_node *cpu, *ic; | 277 | struct device_node *cpu, *ic; |
280 | int *fp; | 278 | const int *fp; |
281 | unsigned long pvr; | 279 | unsigned long pvr; |
282 | 280 | ||
283 | pvr = PVR_VER(mfspr(SPRN_PVR)); | 281 | pvr = PVR_VER(mfspr(SPRN_PVR)); |
@@ -287,7 +285,7 @@ static void __init pmac_setup_arch(void) | |||
287 | loops_per_jiffy = 50000000 / HZ; | 285 | loops_per_jiffy = 50000000 / HZ; |
288 | cpu = of_find_node_by_type(NULL, "cpu"); | 286 | cpu = of_find_node_by_type(NULL, "cpu"); |
289 | if (cpu != NULL) { | 287 | if (cpu != NULL) { |
290 | fp = (int *) get_property(cpu, "clock-frequency", NULL); | 288 | fp = get_property(cpu, "clock-frequency", NULL); |
291 | if (fp != NULL) { | 289 | if (fp != NULL) { |
292 | if (pvr >= 0x30 && pvr < 0x80) | 290 | if (pvr >= 0x30 && pvr < 0x80) |
293 | /* PPC970 etc. */ | 291 | /* PPC970 etc. */ |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 827b7121ffb8..653eeb64d1e2 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -548,7 +548,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus) | |||
548 | struct device_node *cc = NULL; | 548 | struct device_node *cc = NULL; |
549 | struct device_node *p; | 549 | struct device_node *p; |
550 | const char *name = NULL; | 550 | const char *name = NULL; |
551 | u32 *reg; | 551 | const u32 *reg; |
552 | int ok; | 552 | int ok; |
553 | 553 | ||
554 | /* Look for the clock chip */ | 554 | /* Look for the clock chip */ |
@@ -562,7 +562,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus) | |||
562 | pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); | 562 | pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); |
563 | if (pmac_tb_clock_chip_host == NULL) | 563 | if (pmac_tb_clock_chip_host == NULL) |
564 | continue; | 564 | continue; |
565 | reg = (u32 *)get_property(cc, "reg", NULL); | 565 | reg = get_property(cc, "reg", NULL); |
566 | if (reg == NULL) | 566 | if (reg == NULL) |
567 | continue; | 567 | continue; |
568 | switch (*reg) { | 568 | switch (*reg) { |
@@ -707,8 +707,7 @@ static void __init smp_core99_setup(int ncpus) | |||
707 | core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */ | 707 | core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */ |
708 | cpu = of_find_node_by_type(NULL, "cpu"); | 708 | cpu = of_find_node_by_type(NULL, "cpu"); |
709 | if (cpu != NULL) { | 709 | if (cpu != NULL) { |
710 | tbprop = (u32 *)get_property(cpu, "timebase-enable", | 710 | tbprop = get_property(cpu, "timebase-enable", NULL); |
711 | NULL); | ||
712 | if (tbprop) | 711 | if (tbprop) |
713 | core99_tb_gpio = *tbprop; | 712 | core99_tb_gpio = *tbprop; |
714 | of_node_put(cpu); | 713 | of_node_put(cpu); |
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c index 37e5b1eff911..ce1a235855f7 100644 --- a/arch/powerpc/platforms/powermac/udbg_scc.c +++ b/arch/powerpc/platforms/powermac/udbg_scc.c | |||
@@ -68,11 +68,11 @@ static unsigned char scc_inittab[] = { | |||
68 | 68 | ||
69 | void udbg_scc_init(int force_scc) | 69 | void udbg_scc_init(int force_scc) |
70 | { | 70 | { |
71 | u32 *reg; | 71 | const u32 *reg; |
72 | unsigned long addr; | 72 | unsigned long addr; |
73 | struct device_node *stdout = NULL, *escc = NULL, *macio = NULL; | 73 | struct device_node *stdout = NULL, *escc = NULL, *macio = NULL; |
74 | struct device_node *ch, *ch_def = NULL, *ch_a = NULL; | 74 | struct device_node *ch, *ch_def = NULL, *ch_a = NULL; |
75 | char *path; | 75 | const char *path; |
76 | int i, x; | 76 | int i, x; |
77 | 77 | ||
78 | escc = of_find_node_by_name(NULL, "escc"); | 78 | escc = of_find_node_by_name(NULL, "escc"); |
@@ -81,7 +81,7 @@ void udbg_scc_init(int force_scc) | |||
81 | macio = of_get_parent(escc); | 81 | macio = of_get_parent(escc); |
82 | if (macio == NULL) | 82 | if (macio == NULL) |
83 | goto bail; | 83 | goto bail; |
84 | path = (char *)get_property(of_chosen, "linux,stdout-path", NULL); | 84 | path = get_property(of_chosen, "linux,stdout-path", NULL); |
85 | if (path != NULL) | 85 | if (path != NULL) |
86 | stdout = of_find_node_by_path(path); | 86 | stdout = of_find_node_by_path(path); |
87 | for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) { | 87 | for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) { |
@@ -96,13 +96,13 @@ void udbg_scc_init(int force_scc) | |||
96 | ch = ch_def ? ch_def : ch_a; | 96 | ch = ch_def ? ch_def : ch_a; |
97 | 97 | ||
98 | /* Get address within mac-io ASIC */ | 98 | /* Get address within mac-io ASIC */ |
99 | reg = (u32 *)get_property(escc, "reg", NULL); | 99 | reg = get_property(escc, "reg", NULL); |
100 | if (reg == NULL) | 100 | if (reg == NULL) |
101 | goto bail; | 101 | goto bail; |
102 | addr = reg[0]; | 102 | addr = reg[0]; |
103 | 103 | ||
104 | /* Get address of mac-io PCI itself */ | 104 | /* Get address of mac-io PCI itself */ |
105 | reg = (u32 *)get_property(macio, "assigned-addresses", NULL); | 105 | reg = get_property(macio, "assigned-addresses", NULL); |
106 | if (reg == NULL) | 106 | if (reg == NULL) |
107 | goto bail; | 107 | goto bail; |
108 | addr += reg[2]; | 108 | addr += reg[2]; |