diff options
Diffstat (limited to 'drivers/cpufreq/maple-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/maple-cpufreq.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c index cdd62915efaf..f071dc49f129 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 | ||
@@ -201,7 +201,6 @@ static struct cpufreq_driver maple_cpufreq_driver = { | |||
201 | 201 | ||
202 | static int __init maple_cpufreq_init(void) | 202 | static int __init maple_cpufreq_init(void) |
203 | { | 203 | { |
204 | struct device_node *cpus; | ||
205 | struct device_node *cpunode; | 204 | struct device_node *cpunode; |
206 | unsigned int psize; | 205 | unsigned int psize; |
207 | unsigned long max_freq; | 206 | unsigned long max_freq; |
@@ -217,24 +216,11 @@ static int __init maple_cpufreq_init(void) | |||
217 | !of_machine_is_compatible("Momentum,Apache")) | 216 | !of_machine_is_compatible("Momentum,Apache")) |
218 | return 0; | 217 | return 0; |
219 | 218 | ||
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 */ | 219 | /* Get first CPU node */ |
227 | for (cpunode = NULL; | 220 | 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) { | 221 | if (cpunode == NULL) { |
236 | printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n"); | 222 | printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n"); |
237 | goto bail_cpus; | 223 | goto bail_noprops; |
238 | } | 224 | } |
239 | 225 | ||
240 | /* Check 970FX for now */ | 226 | /* Check 970FX for now */ |
@@ -290,14 +276,11 @@ static int __init maple_cpufreq_init(void) | |||
290 | rc = cpufreq_register_driver(&maple_cpufreq_driver); | 276 | rc = cpufreq_register_driver(&maple_cpufreq_driver); |
291 | 277 | ||
292 | of_node_put(cpunode); | 278 | of_node_put(cpunode); |
293 | of_node_put(cpus); | ||
294 | 279 | ||
295 | return rc; | 280 | return rc; |
296 | 281 | ||
297 | bail_noprops: | 282 | bail_noprops: |
298 | of_node_put(cpunode); | 283 | of_node_put(cpunode); |
299 | bail_cpus: | ||
300 | of_node_put(cpus); | ||
301 | 284 | ||
302 | return rc; | 285 | return rc; |
303 | } | 286 | } |