aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-04-03 08:26:41 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-12 13:55:19 -0400
commite2eb63927bfcb54232163bfec32440246fd44457 (patch)
tree596656edeb2332b5134d8236fa50b87f2c0ece29 /arch/powerpc/platforms/powermac
parentceef87782a9452eeeca774e65d7f4e06455780a3 (diff)
[POWERPC] Rename get_property to of_get_property: arch/powerpc
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac')
-rw-r--r--arch/powerpc/platforms/powermac/backlight.c2
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c21
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c16
-rw-r--r--arch/powerpc/platforms/powermac/feature.c24
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c15
-rw-r--r--arch/powerpc/platforms/powermac/pci.c16
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_base.c2
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_core.c2
-rw-r--r--arch/powerpc/platforms/powermac/pic.c6
-rw-r--r--arch/powerpc/platforms/powermac/setup.c20
-rw-r--r--arch/powerpc/platforms/powermac/smp.c6
-rw-r--r--arch/powerpc/platforms/powermac/udbg_scc.c6
12 files changed, 70 insertions, 66 deletions
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c
index de7440e62cc4..0dc8a45c408a 100644
--- a/arch/powerpc/platforms/powermac/backlight.c
+++ b/arch/powerpc/platforms/powermac/backlight.c
@@ -59,7 +59,7 @@ int pmac_has_backlight_type(const char *type)
59 struct device_node* bk_node = find_devices("backlight"); 59 struct device_node* bk_node = find_devices("backlight");
60 60
61 if (bk_node) { 61 if (bk_node) {
62 const char *prop = get_property(bk_node, 62 const char *prop = of_get_property(bk_node,
63 "backlight-control", NULL); 63 "backlight-control", NULL);
64 if (prop && strncmp(prop, type, strlen(type)) == 0) 64 if (prop && strncmp(prop, type, strlen(type)) == 0)
65 return 1; 65 return 1;
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index c2b6b4134f68..76eda9fcd1aa 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
422static u32 read_gpio(struct device_node *np) 422static u32 read_gpio(struct device_node *np)
423{ 423{
424 const u32 *reg = get_property(np, "reg", NULL); 424 const u32 *reg = of_get_property(np, "reg", NULL);
425 u32 offset; 425 u32 offset;
426 426
427 if (reg == NULL) 427 if (reg == NULL)
@@ -521,13 +521,14 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
521 int lenp, rc; 521 int lenp, rc;
522 const u32 *freqs, *ratio; 522 const u32 *freqs, *ratio;
523 523
524 freqs = get_property(cpunode, "bus-frequencies", &lenp); 524 freqs = of_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 = get_property(cpunode, "processor-to-bus-ratio*2", NULL); 530 ratio = of_get_property(cpunode, "processor-to-bus-ratio*2",
531 NULL);
531 if (ratio == NULL) { 532 if (ratio == NULL) {
532 printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); 533 printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n");
533 return 1; 534 return 1;
@@ -562,7 +563,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 563 /* If we use the PMU, look for the min & max frequencies in the
563 * device-tree 564 * device-tree
564 */ 565 */
565 value = get_property(cpunode, "min-clock-frequency", NULL); 566 value = of_get_property(cpunode, "min-clock-frequency", NULL);
566 if (!value) 567 if (!value)
567 return 1; 568 return 1;
568 low_freq = (*value) / 1000; 569 low_freq = (*value) / 1000;
@@ -571,7 +572,7 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
571 if (low_freq < 100000) 572 if (low_freq < 100000)
572 low_freq *= 10; 573 low_freq *= 10;
573 574
574 value = get_property(cpunode, "max-clock-frequency", NULL); 575 value = of_get_property(cpunode, "max-clock-frequency", NULL);
575 if (!value) 576 if (!value)
576 return 1; 577 return 1;
577 hi_freq = (*value) / 1000; 578 hi_freq = (*value) / 1000;
@@ -585,7 +586,7 @@ static int pmac_cpufreq_init_7447A(struct device_node *cpunode)
585{ 586{
586 struct device_node *volt_gpio_np; 587 struct device_node *volt_gpio_np;
587 588
588 if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) 589 if (of_get_property(cpunode, "dynamic-power-step", NULL) == NULL)
589 return 1; 590 return 1;
590 591
591 volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select"); 592 volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select");
@@ -614,11 +615,11 @@ static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
614 u32 pvr; 615 u32 pvr;
615 const u32 *value; 616 const u32 *value;
616 617
617 if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) 618 if (of_get_property(cpunode, "dynamic-power-step", NULL) == NULL)
618 return 1; 619 return 1;
619 620
620 hi_freq = cur_freq; 621 hi_freq = cur_freq;
621 value = get_property(cpunode, "reduced-clock-frequency", NULL); 622 value = of_get_property(cpunode, "reduced-clock-frequency", NULL);
622 if (!value) 623 if (!value)
623 return 1; 624 return 1;
624 low_freq = (*value) / 1000; 625 low_freq = (*value) / 1000;
@@ -662,14 +663,14 @@ static int __init pmac_cpufreq_setup(void)
662 goto out; 663 goto out;
663 664
664 /* Get current cpu clock freq */ 665 /* Get current cpu clock freq */
665 value = get_property(cpunode, "clock-frequency", NULL); 666 value = of_get_property(cpunode, "clock-frequency", NULL);
666 if (!value) 667 if (!value)
667 goto out; 668 goto out;
668 cur_freq = (*value) / 1000; 669 cur_freq = (*value) / 1000;
669 670
670 /* Check for 7447A based MacRISC3 */ 671 /* Check for 7447A based MacRISC3 */
671 if (machine_is_compatible("MacRISC3") && 672 if (machine_is_compatible("MacRISC3") &&
672 get_property(cpunode, "dynamic-power-step", NULL) && 673 of_get_property(cpunode, "dynamic-power-step", NULL) &&
673 PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { 674 PVR_VER(mfspr(SPRN_PVR)) == 0x8003) {
674 pmac_cpufreq_init_7447A(cpunode); 675 pmac_cpufreq_init_7447A(cpunode);
675 /* Check for other MacRISC3 machines */ 676 /* Check for other MacRISC3 machines */
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index 9d22361a26d6..567d5523b690 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -410,7 +410,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
410 /* Get first CPU node */ 410 /* Get first CPU node */
411 for (cpunode = NULL; 411 for (cpunode = NULL;
412 (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { 412 (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {
413 const u32 *reg = get_property(cpunode, "reg", NULL); 413 const u32 *reg = of_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 = get_property(cpunode, "cpu-version", NULL); 425 valp = of_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 = get_property(cpunode, "power-mode-data",&psize); 437 g5_pmode_data = of_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;
@@ -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 = get_property(cpunode, "clock-frequency", NULL); 496 valp = of_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;
@@ -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 = get_property(cpuid, "cpuid", NULL); 566 eeprom = of_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,13 +573,13 @@ 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 const char *loc = get_property(hwclock, 576 const char *loc = of_get_property(hwclock,
577 "hwctrl-location", NULL); 577 "hwctrl-location", NULL);
578 if (loc == NULL) 578 if (loc == NULL)
579 continue; 579 continue;
580 if (strcmp(loc, "CPU CLOCK")) 580 if (strcmp(loc, "CPU CLOCK"))
581 continue; 581 continue;
582 if (!get_property(hwclock, "platform-get-frequency", NULL)) 582 if (!of_get_property(hwclock, "platform-get-frequency", NULL))
583 continue; 583 continue;
584 break; 584 break;
585 } 585 }
@@ -638,7 +638,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
638 */ 638 */
639 639
640 /* Get max frequency from device-tree */ 640 /* Get max frequency from device-tree */
641 valp = get_property(cpunode, "clock-frequency", NULL); 641 valp = of_get_property(cpunode, "clock-frequency", NULL);
642 if (!valp) { 642 if (!valp) {
643 printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); 643 printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n");
644 rc = -ENODEV; 644 rc = -ENODEV;
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 24cc50c1774a..103fcc4c5605 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -1057,8 +1057,8 @@ core99_reset_cpu(struct device_node *node, long param, long value)
1057 if (np == NULL) 1057 if (np == NULL)
1058 return -ENODEV; 1058 return -ENODEV;
1059 for (np = np->child; np != NULL; np = np->sibling) { 1059 for (np = np->child; np != NULL; np = np->sibling) {
1060 const u32 *num = get_property(np, "reg", NULL); 1060 const u32 *num = of_get_property(np, "reg", NULL);
1061 const u32 *rst = get_property(np, "soft-reset", NULL); 1061 const u32 *rst = of_get_property(np, "soft-reset", NULL);
1062 if (num == NULL || rst == NULL) 1062 if (num == NULL || rst == NULL)
1063 continue; 1063 continue;
1064 if (param == *num) { 1064 if (param == *num) {
@@ -1095,7 +1095,7 @@ core99_usb_enable(struct device_node *node, long param, long value)
1095 macio->type != macio_intrepid) 1095 macio->type != macio_intrepid)
1096 return -ENODEV; 1096 return -ENODEV;
1097 1097
1098 prop = get_property(node, "AAPL,clock-id", NULL); 1098 prop = of_get_property(node, "AAPL,clock-id", NULL);
1099 if (!prop) 1099 if (!prop)
1100 return -ENODEV; 1100 return -ENODEV;
1101 if (strncmp(prop, "usb0u048", 8) == 0) 1101 if (strncmp(prop, "usb0u048", 8) == 0)
@@ -1506,8 +1506,8 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)
1506 if (np == NULL) 1506 if (np == NULL)
1507 return -ENODEV; 1507 return -ENODEV;
1508 for (np = np->child; np != NULL; np = np->sibling) { 1508 for (np = np->child; np != NULL; np = np->sibling) {
1509 const u32 *num = get_property(np, "reg", NULL); 1509 const u32 *num = of_get_property(np, "reg", NULL);
1510 const u32 *rst = get_property(np, "soft-reset", NULL); 1510 const u32 *rst = of_get_property(np, "soft-reset", NULL);
1511 if (num == NULL || rst == NULL) 1511 if (num == NULL || rst == NULL)
1512 continue; 1512 continue;
1513 if (param == *num) { 1513 if (param == *num) {
@@ -2411,7 +2411,7 @@ static int __init probe_motherboard(void)
2411 */ 2411 */
2412 dt = find_devices("device-tree"); 2412 dt = find_devices("device-tree");
2413 if (dt != NULL) 2413 if (dt != NULL)
2414 model = get_property(dt, "model", NULL); 2414 model = of_get_property(dt, "model", NULL);
2415 for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { 2415 for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
2416 if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { 2416 if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
2417 pmac_mb = pmac_mb_defs[i]; 2417 pmac_mb = pmac_mb_defs[i];
@@ -2509,7 +2509,7 @@ found:
2509 if (np->sibling) 2509 if (np->sibling)
2510 break; 2510 break;
2511 /* Nap mode not supported if flush-on-lock property is present */ 2511 /* Nap mode not supported if flush-on-lock property is present */
2512 if (get_property(np, "flush-on-lock", NULL)) 2512 if (of_get_property(np, "flush-on-lock", NULL))
2513 break; 2513 break;
2514 powersave_nap = 1; 2514 powersave_nap = 1;
2515 printk(KERN_DEBUG "Processor NAP mode on idle enabled.\n"); 2515 printk(KERN_DEBUG "Processor NAP mode on idle enabled.\n");
@@ -2558,7 +2558,7 @@ static void __init probe_uninorth(void)
2558 if (uninorth_node == NULL) 2558 if (uninorth_node == NULL)
2559 return; 2559 return;
2560 2560
2561 addrp = get_property(uninorth_node, "reg", NULL); 2561 addrp = of_get_property(uninorth_node, "reg", NULL);
2562 if (addrp == NULL) 2562 if (addrp == NULL)
2563 return; 2563 return;
2564 address = of_translate_address(uninorth_node, addrp); 2564 address = of_translate_address(uninorth_node, addrp);
@@ -2642,7 +2642,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
2642 return; 2642 return;
2643 } 2643 }
2644 if (type == macio_keylargo || type == macio_keylargo2) { 2644 if (type == macio_keylargo || type == macio_keylargo2) {
2645 const u32 *did = get_property(node, "device-id", NULL); 2645 const u32 *did = of_get_property(node, "device-id", NULL);
2646 if (*did == 0x00000025) 2646 if (*did == 0x00000025)
2647 type = macio_pangea; 2647 type = macio_pangea;
2648 if (*did == 0x0000003e) 2648 if (*did == 0x0000003e)
@@ -2655,7 +2655,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
2655 macio_chips[i].base = base; 2655 macio_chips[i].base = base;
2656 macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON; 2656 macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON;
2657 macio_chips[i].name = macio_names[type]; 2657 macio_chips[i].name = macio_names[type];
2658 revp = get_property(node, "revision-id", NULL); 2658 revp = of_get_property(node, "revision-id", NULL);
2659 if (revp) 2659 if (revp)
2660 macio_chips[i].rev = *revp; 2660 macio_chips[i].rev = *revp;
2661 printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", 2661 printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n",
@@ -2706,8 +2706,8 @@ initial_serial_shutdown(struct device_node *np)
2706 int port_type = PMAC_SCC_ASYNC; 2706 int port_type = PMAC_SCC_ASYNC;
2707 int modem = 0; 2707 int modem = 0;
2708 2708
2709 slots = get_property(np, "slot-names", &len); 2709 slots = of_get_property(np, "slot-names", &len);
2710 conn = get_property(np, "AAPL,connector", &len); 2710 conn = of_get_property(np, "AAPL,connector", &len);
2711 if (conn && (strcmp(conn, "infrared") == 0)) 2711 if (conn && (strcmp(conn, "infrared") == 0))
2712 port_type = PMAC_SCC_IRDA; 2712 port_type = PMAC_SCC_IRDA;
2713 else if (device_is_compatible(np, "cobalt")) 2713 else if (device_is_compatible(np, "cobalt"))
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index bfc4829162f1..5430e146b3e9 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -491,7 +491,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
491 * 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
492 * to macio parsing if that wasn't the case 492 * to macio parsing if that wasn't the case
493 */ 493 */
494 addrp = get_property(np, "AAPL,address", NULL); 494 addrp = of_get_property(np, "AAPL,address", NULL);
495 if (addrp == NULL) { 495 if (addrp == NULL) {
496 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",
497 np->full_name); 497 np->full_name);
@@ -505,13 +505,13 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
505 host->timeout_timer.function = kw_i2c_timeout; 505 host->timeout_timer.function = kw_i2c_timeout;
506 host->timeout_timer.data = (unsigned long)host; 506 host->timeout_timer.data = (unsigned long)host;
507 507
508 psteps = get_property(np, "AAPL,address-step", NULL); 508 psteps = of_get_property(np, "AAPL,address-step", NULL);
509 steps = psteps ? (*psteps) : 0x10; 509 steps = psteps ? (*psteps) : 0x10;
510 for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) 510 for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++)
511 steps >>= 1; 511 steps >>= 1;
512 /* Select interface rate */ 512 /* Select interface rate */
513 host->speed = KW_I2C_MODE_25KHZ; 513 host->speed = KW_I2C_MODE_25KHZ;
514 prate = get_property(np, "AAPL,i2c-rate", NULL); 514 prate = of_get_property(np, "AAPL,i2c-rate", NULL);
515 if (prate) switch(*prate) { 515 if (prate) switch(*prate) {
516 case 100: 516 case 100:
517 host->speed = KW_I2C_MODE_100KHZ; 517 host->speed = KW_I2C_MODE_100KHZ;
@@ -619,7 +619,7 @@ static void __init kw_i2c_probe(void)
619 } else { 619 } else {
620 for (child = NULL; 620 for (child = NULL;
621 (child = of_get_next_child(np, child)) != NULL;) { 621 (child = of_get_next_child(np, child)) != NULL;) {
622 const u32 *reg = get_property(child, 622 const u32 *reg = of_get_property(child,
623 "reg", NULL); 623 "reg", NULL);
624 if (reg == NULL) 624 if (reg == NULL)
625 continue; 625 continue;
@@ -905,7 +905,7 @@ static void __init smu_i2c_probe(void)
905 if (strcmp(busnode->type, "i2c") && 905 if (strcmp(busnode->type, "i2c") &&
906 strcmp(busnode->type, "i2c-bus")) 906 strcmp(busnode->type, "i2c-bus"))
907 continue; 907 continue;
908 reg = get_property(busnode, "reg", NULL); 908 reg = of_get_property(busnode, "reg", NULL);
909 if (reg == NULL) 909 if (reg == NULL)
910 continue; 910 continue;
911 911
@@ -950,7 +950,8 @@ struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node)
950 if (p == bus->busnode) { 950 if (p == bus->busnode) {
951 if (prev && bus->flags & pmac_i2c_multibus) { 951 if (prev && bus->flags & pmac_i2c_multibus) {
952 const u32 *reg; 952 const u32 *reg;
953 reg = get_property(prev, "reg", NULL); 953 reg = of_get_property(prev, "reg",
954 NULL);
954 if (!reg) 955 if (!reg)
955 continue; 956 continue;
956 if (((*reg) >> 8) != bus->channel) 957 if (((*reg) >> 8) != bus->channel)
@@ -971,7 +972,7 @@ EXPORT_SYMBOL_GPL(pmac_i2c_find_bus);
971 972
972u8 pmac_i2c_get_dev_addr(struct device_node *device) 973u8 pmac_i2c_get_dev_addr(struct device_node *device)
973{ 974{
974 const u32 *reg = get_property(device, "reg", NULL); 975 const u32 *reg = of_get_property(device, "reg", NULL);
975 976
976 if (reg == NULL) 977 if (reg == NULL)
977 return 0; 978 return 0;
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 431a685a15dd..092cef4160a1 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -70,11 +70,11 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher
70 int len; 70 int len;
71 71
72 /* For PCI<->PCI bridges or CardBus bridges, we go down */ 72 /* For PCI<->PCI bridges or CardBus bridges, we go down */
73 class_code = get_property(node, "class-code", NULL); 73 class_code = of_get_property(node, "class-code", NULL);
74 if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && 74 if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
75 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) 75 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
76 continue; 76 continue;
77 bus_range = get_property(node, "bus-range", &len); 77 bus_range = of_get_property(node, "bus-range", &len);
78 if (bus_range != NULL && len > 2 * sizeof(int)) { 78 if (bus_range != NULL && len > 2 * sizeof(int)) {
79 if (bus_range[1] > higher) 79 if (bus_range[1] > higher)
80 higher = bus_range[1]; 80 higher = bus_range[1];
@@ -246,8 +246,8 @@ static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
246 if (np == NULL) 246 if (np == NULL)
247 return PCIBIOS_DEVICE_NOT_FOUND; 247 return PCIBIOS_DEVICE_NOT_FOUND;
248 248
249 vendor = get_property(np, "vendor-id", NULL); 249 vendor = of_get_property(np, "vendor-id", NULL);
250 device = get_property(np, "device-id", NULL); 250 device = of_get_property(np, "device-id", NULL);
251 if (vendor == NULL || device == NULL) 251 if (vendor == NULL || device == NULL)
252 return PCIBIOS_DEVICE_NOT_FOUND; 252 return PCIBIOS_DEVICE_NOT_FOUND;
253 253
@@ -691,17 +691,17 @@ static void __init fixup_nec_usb2(void)
691 const u32 *prop; 691 const u32 *prop;
692 u8 bus, devfn; 692 u8 bus, devfn;
693 693
694 prop = get_property(nec, "vendor-id", NULL); 694 prop = of_get_property(nec, "vendor-id", NULL);
695 if (prop == NULL) 695 if (prop == NULL)
696 continue; 696 continue;
697 if (0x1033 != *prop) 697 if (0x1033 != *prop)
698 continue; 698 continue;
699 prop = get_property(nec, "device-id", NULL); 699 prop = of_get_property(nec, "device-id", NULL);
700 if (prop == NULL) 700 if (prop == NULL)
701 continue; 701 continue;
702 if (0x0035 != *prop) 702 if (0x0035 != *prop)
703 continue; 703 continue;
704 prop = get_property(nec, "reg", NULL); 704 prop = of_get_property(nec, "reg", NULL);
705 if (prop == NULL) 705 if (prop == NULL)
706 continue; 706 continue;
707 devfn = (prop[0] >> 8) & 0xff; 707 devfn = (prop[0] >> 8) & 0xff;
@@ -909,7 +909,7 @@ static int __init add_bridge(struct device_node *dev)
909 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); 909 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
910 910
911 /* Get bus range if any */ 911 /* Get bus range if any */
912 bus_range = get_property(dev, "bus-range", &len); 912 bus_range = of_get_property(dev, "bus-range", &len);
913 if (bus_range == NULL || len < 2 * sizeof(int)) { 913 if (bus_range == NULL || len < 2 * sizeof(int)) {
914 printk(KERN_WARNING "Can't get bus-range for %s, assume" 914 printk(KERN_WARNING "Can't get bus-range for %s, assume"
915 " bus 0\n", dev->full_name); 915 " 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 5c6c15c5f9a3..45d54b9ad9e0 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 const u32 *reg = get_property(gp, "reg", NULL); 117 const u32 *reg = of_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 a128553b8413..85434231ae14 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -820,7 +820,7 @@ struct pmf_function *__pmf_find_function(struct device_node *target,
820 * one, then we fallback to a direct call attempt 820 * one, then we fallback to a direct call attempt
821 */ 821 */
822 snprintf(fname, 63, "platform-%s", name); 822 snprintf(fname, 63, "platform-%s", name);
823 prop = get_property(target, fname, NULL); 823 prop = of_get_property(target, fname, NULL);
824 if (prop == NULL) 824 if (prop == NULL)
825 goto find_it; 825 goto find_it;
826 ph = *prop; 826 ph = *prop;
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 5e5c0e4add91..f59d311e25da 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -482,7 +482,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np,
482 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); 482 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0);
483 483
484 flags |= MPIC_WANTS_RESET; 484 flags |= MPIC_WANTS_RESET;
485 if (get_property(np, "big-endian", NULL)) 485 if (of_get_property(np, "big-endian", NULL))
486 flags |= MPIC_BIG_ENDIAN; 486 flags |= MPIC_BIG_ENDIAN;
487 487
488 /* Primary Big Endian means HT interrupts. This is quite dodgy 488 /* Primary Big Endian means HT interrupts. This is quite dodgy
@@ -510,7 +510,7 @@ static int __init pmac_pic_probe_mpic(void)
510 for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) 510 for (np = NULL; (np = of_find_node_by_type(np, "open-pic"))
511 != NULL;) { 511 != NULL;) {
512 if (master == NULL && 512 if (master == NULL &&
513 get_property(np, "interrupts", NULL) == NULL) 513 of_get_property(np, "interrupts", NULL) == NULL)
514 master = of_node_get(np); 514 master = of_node_get(np);
515 else if (slave == NULL) 515 else if (slave == NULL)
516 slave = of_node_get(np); 516 slave = of_node_get(np);
@@ -575,7 +575,7 @@ void __init pmac_pic_init(void)
575#ifdef CONFIG_PPC32 575#ifdef CONFIG_PPC32
576 if (!pmac_newworld) 576 if (!pmac_newworld)
577 flags |= OF_IMAP_OLDWORLD_MAC; 577 flags |= OF_IMAP_OLDWORLD_MAC;
578 if (get_property(of_chosen, "linux,bootx", NULL) != NULL) 578 if (of_get_property(of_chosen, "linux,bootx", NULL) != NULL)
579 flags |= OF_IMAP_NO_PHANDLE; 579 flags |= OF_IMAP_NO_PHANDLE;
580#endif /* CONFIG_PPC_32 */ 580#endif /* CONFIG_PPC_32 */
581 581
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index f2a3063980eb..8c96f2461e9a 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -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 = get_property(np, "model", NULL); 137 pp = of_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 = get_property(np, "compatible", &plen); 142 pp = of_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,11 +163,13 @@ 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 const unsigned int *ic = get_property(np, "i-cache-size", NULL); 166 const unsigned int *ic =
167 const unsigned int *dc = get_property(np, "d-cache-size", NULL); 167 of_get_property(np, "i-cache-size", NULL);
168 const unsigned int *dc =
169 of_get_property(np, "d-cache-size", NULL);
168 seq_printf(m, "L2 cache\t:"); 170 seq_printf(m, "L2 cache\t:");
169 has_l2cache = 1; 171 has_l2cache = 1;
170 if (get_property(np, "cache-unified", NULL) != 0 && dc) { 172 if (of_get_property(np, "cache-unified", NULL) != 0 && dc) {
171 seq_printf(m, " %dK unified", *dc / 1024); 173 seq_printf(m, " %dK unified", *dc / 1024);
172 } else { 174 } else {
173 if (ic) 175 if (ic)
@@ -176,7 +178,7 @@ static void pmac_show_cpuinfo(struct seq_file *m)
176 seq_printf(m, "%s %dK data", 178 seq_printf(m, "%s %dK data",
177 (ic? " +": ""), *dc / 1024); 179 (ic? " +": ""), *dc / 1024);
178 } 180 }
179 pp = get_property(np, "ram-type", NULL); 181 pp = of_get_property(np, "ram-type", NULL);
180 if (pp) 182 if (pp)
181 seq_printf(m, " %s", pp); 183 seq_printf(m, " %s", pp);
182 seq_printf(m, "\n"); 184 seq_printf(m, "\n");
@@ -253,7 +255,7 @@ static void __init l2cr_init(void)
253 np = find_type_devices("cpu"); 255 np = find_type_devices("cpu");
254 if (np != 0) { 256 if (np != 0) {
255 const unsigned int *l2cr = 257 const unsigned int *l2cr =
256 get_property(np, "l2cr-value", NULL); 258 of_get_property(np, "l2cr-value", NULL);
257 if (l2cr != 0) { 259 if (l2cr != 0) {
258 ppc_override_l2cr = 1; 260 ppc_override_l2cr = 1;
259 ppc_override_l2cr_value = *l2cr; 261 ppc_override_l2cr_value = *l2cr;
@@ -285,7 +287,7 @@ static void __init pmac_setup_arch(void)
285 loops_per_jiffy = 50000000 / HZ; 287 loops_per_jiffy = 50000000 / HZ;
286 cpu = of_find_node_by_type(NULL, "cpu"); 288 cpu = of_find_node_by_type(NULL, "cpu");
287 if (cpu != NULL) { 289 if (cpu != NULL) {
288 fp = get_property(cpu, "clock-frequency", NULL); 290 fp = of_get_property(cpu, "clock-frequency", NULL);
289 if (fp != NULL) { 291 if (fp != NULL) {
290 if (pvr >= 0x30 && pvr < 0x80) 292 if (pvr >= 0x30 && pvr < 0x80)
291 /* PPC970 etc. */ 293 /* PPC970 etc. */
@@ -302,7 +304,7 @@ static void __init pmac_setup_arch(void)
302 304
303 /* See if newworld or oldworld */ 305 /* See if newworld or oldworld */
304 for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; ) 306 for (ic = NULL; (ic = of_find_all_nodes(ic)) != NULL; )
305 if (get_property(ic, "interrupt-controller", NULL)) 307 if (of_get_property(ic, "interrupt-controller", NULL))
306 break; 308 break;
307 if (ic) { 309 if (ic) {
308 pmac_newworld = 1; 310 pmac_newworld = 1;
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index d73fb73802bb..20f328678fd1 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -567,7 +567,7 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus)
567 pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); 567 pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc);
568 if (pmac_tb_clock_chip_host == NULL) 568 if (pmac_tb_clock_chip_host == NULL)
569 continue; 569 continue;
570 reg = get_property(cc, "reg", NULL); 570 reg = of_get_property(cc, "reg", NULL);
571 if (reg == NULL) 571 if (reg == NULL)
572 continue; 572 continue;
573 switch (*reg) { 573 switch (*reg) {
@@ -695,7 +695,7 @@ static void __init smp_core99_setup(int ncpus)
695 struct device_node *cpus = 695 struct device_node *cpus =
696 of_find_node_by_path("/cpus"); 696 of_find_node_by_path("/cpus");
697 if (cpus && 697 if (cpus &&
698 get_property(cpus, "platform-cpu-timebase", NULL)) { 698 of_get_property(cpus, "platform-cpu-timebase", NULL)) {
699 pmac_tb_freeze = smp_core99_pfunc_tb_freeze; 699 pmac_tb_freeze = smp_core99_pfunc_tb_freeze;
700 printk(KERN_INFO "Processor timebase sync using" 700 printk(KERN_INFO "Processor timebase sync using"
701 " platform function\n"); 701 " platform function\n");
@@ -712,7 +712,7 @@ static void __init smp_core99_setup(int ncpus)
712 core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */ 712 core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */
713 cpu = of_find_node_by_type(NULL, "cpu"); 713 cpu = of_find_node_by_type(NULL, "cpu");
714 if (cpu != NULL) { 714 if (cpu != NULL) {
715 tbprop = get_property(cpu, "timebase-enable", NULL); 715 tbprop = of_get_property(cpu, "timebase-enable", NULL);
716 if (tbprop) 716 if (tbprop)
717 core99_tb_gpio = *tbprop; 717 core99_tb_gpio = *tbprop;
718 of_node_put(cpu); 718 of_node_put(cpu);
diff --git a/arch/powerpc/platforms/powermac/udbg_scc.c b/arch/powerpc/platforms/powermac/udbg_scc.c
index 379db05b0082..47de4d3fc167 100644
--- a/arch/powerpc/platforms/powermac/udbg_scc.c
+++ b/arch/powerpc/platforms/powermac/udbg_scc.c
@@ -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 = get_property(of_chosen, "linux,stdout-path", NULL); 84 path = of_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 = get_property(escc, "reg", NULL); 99 reg = of_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 = get_property(macio, "assigned-addresses", NULL); 105 reg = of_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];