aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/maple-cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/maple-cpufreq.c')
-rw-r--r--drivers/cpufreq/maple-cpufreq.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c
index cdd62915efaf..6168d77b296d 100644
--- a/drivers/cpufreq/maple-cpufreq.c
+++ b/drivers/cpufreq/maple-cpufreq.c
@@ -24,7 +24,7 @@
24#include <linux/completion.h> 24#include <linux/completion.h>
25#include <linux/mutex.h> 25#include <linux/mutex.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/of.h> 27#include <linux/of_device.h>
28 28
29#define DBG(fmt...) pr_debug(fmt) 29#define DBG(fmt...) pr_debug(fmt)
30 30
@@ -190,7 +190,6 @@ static int maple_cpufreq_cpu_init(struct cpufreq_policy *policy)
190 190
191static struct cpufreq_driver maple_cpufreq_driver = { 191static struct cpufreq_driver maple_cpufreq_driver = {
192 .name = "maple", 192 .name = "maple",
193 .owner = THIS_MODULE,
194 .flags = CPUFREQ_CONST_LOOPS, 193 .flags = CPUFREQ_CONST_LOOPS,
195 .init = maple_cpufreq_cpu_init, 194 .init = maple_cpufreq_cpu_init,
196 .verify = maple_cpufreq_verify, 195 .verify = maple_cpufreq_verify,
@@ -201,7 +200,6 @@ static struct cpufreq_driver maple_cpufreq_driver = {
201 200
202static int __init maple_cpufreq_init(void) 201static int __init maple_cpufreq_init(void)
203{ 202{
204 struct device_node *cpus;
205 struct device_node *cpunode; 203 struct device_node *cpunode;
206 unsigned int psize; 204 unsigned int psize;
207 unsigned long max_freq; 205 unsigned long max_freq;
@@ -217,24 +215,11 @@ static int __init maple_cpufreq_init(void)
217 !of_machine_is_compatible("Momentum,Apache")) 215 !of_machine_is_compatible("Momentum,Apache"))
218 return 0; 216 return 0;
219 217
220 cpus = of_find_node_by_path("/cpus");
221 if (cpus == NULL) {
222 DBG("No /cpus node !\n");
223 return -ENODEV;
224 }
225
226 /* Get first CPU node */ 218 /* Get first CPU node */
227 for (cpunode = NULL; 219 cpunode = of_cpu_device_node_get(0);
228 (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {
229 const u32 *reg = of_get_property(cpunode, "reg", NULL);
230 if (reg == NULL || (*reg) != 0)
231 continue;
232 if (!strcmp(cpunode->type, "cpu"))
233 break;
234 }
235 if (cpunode == NULL) { 220 if (cpunode == NULL) {
236 printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n"); 221 printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n");
237 goto bail_cpus; 222 goto bail_noprops;
238 } 223 }
239 224
240 /* Check 970FX for now */ 225 /* Check 970FX for now */
@@ -290,14 +275,11 @@ static int __init maple_cpufreq_init(void)
290 rc = cpufreq_register_driver(&maple_cpufreq_driver); 275 rc = cpufreq_register_driver(&maple_cpufreq_driver);
291 276
292 of_node_put(cpunode); 277 of_node_put(cpunode);
293 of_node_put(cpus);
294 278
295 return rc; 279 return rc;
296 280
297bail_noprops: 281bail_noprops:
298 of_node_put(cpunode); 282 of_node_put(cpunode);
299bail_cpus:
300 of_node_put(cpus);
301 283
302 return rc; 284 return rc;
303} 285}