diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-04-03 08:50:59 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-12 13:55:19 -0400 |
commit | 9c1a2bae0cc52b21121ea2380a2db0294ad0d8e7 (patch) | |
tree | d0fbe9f84d954e2db308f81d91042f348f987c0f /arch/powerpc | |
parent | d05c7a80cf39ae7d0f8d0c3e47c93d51fcd393d3 (diff) |
[POWERPC] Rename get_property to of_get_property: the last one
This also fixes a bug where a property value was being modified
in place.
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')
-rw-r--r-- | arch/powerpc/platforms/cell/cbe_cpufreq.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c index a3850fd1e94c..9c5d63b7e76c 100644 --- a/arch/powerpc/platforms/cell/cbe_cpufreq.c +++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c | |||
@@ -126,7 +126,8 @@ static int set_pmode(int cpu, unsigned int pmode) | |||
126 | 126 | ||
127 | static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy) | 127 | static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy) |
128 | { | 128 | { |
129 | u32 *max_freq; | 129 | const u32 *max_freqp; |
130 | u32 max_freq; | ||
130 | int i, cur_pmode; | 131 | int i, cur_pmode; |
131 | struct device_node *cpu; | 132 | struct device_node *cpu; |
132 | 133 | ||
@@ -137,20 +138,20 @@ static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy) | |||
137 | 138 | ||
138 | pr_debug("init cpufreq on CPU %d\n", policy->cpu); | 139 | pr_debug("init cpufreq on CPU %d\n", policy->cpu); |
139 | 140 | ||
140 | max_freq = (u32*) get_property(cpu, "clock-frequency", NULL); | 141 | max_freqp = of_get_property(cpu, "clock-frequency", NULL); |
141 | 142 | ||
142 | if(!max_freq) | 143 | if (!max_freqp) |
143 | return -EINVAL; | 144 | return -EINVAL; |
144 | 145 | ||
145 | // we need the freq in kHz | 146 | // we need the freq in kHz |
146 | *max_freq /= 1000; | 147 | max_freq = *max_freqp / 1000; |
147 | 148 | ||
148 | pr_debug("max clock-frequency is at %u kHz\n", *max_freq); | 149 | pr_debug("max clock-frequency is at %u kHz\n", max_freq); |
149 | pr_debug("initializing frequency table\n"); | 150 | pr_debug("initializing frequency table\n"); |
150 | 151 | ||
151 | // initialize frequency table | 152 | // initialize frequency table |
152 | for (i=0; cbe_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) { | 153 | for (i=0; cbe_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) { |
153 | cbe_freqs[i].frequency = *max_freq / cbe_freqs[i].index; | 154 | cbe_freqs[i].frequency = max_freq / cbe_freqs[i].index; |
154 | pr_debug("%d: %d\n", i, cbe_freqs[i].frequency); | 155 | pr_debug("%d: %d\n", i, cbe_freqs[i].frequency); |
155 | } | 156 | } |
156 | 157 | ||