aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/cpufreq_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/powermac/cpufreq_32.c')
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c23
1 files changed, 12 insertions, 11 deletions
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
422static u32 read_gpio(struct device_node *np) 422static 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)
611static int pmac_cpufreq_init_750FX(struct device_node *cpunode) 611static 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)
650static int __init pmac_cpufreq_setup(void) 651static 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;