aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>2013-07-17 07:39:29 -0400
committerSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>2013-08-21 05:29:55 -0400
commit2421d4c34d492efd8b116ce62ae5612b5b9864b2 (patch)
treec4cf9510e1cb851eb77afb2a5d07e6b80ae4078a /drivers/cpufreq
parentda0eb143dbbaf26b6f084bee81d56fc64efb5390 (diff)
cpufreq: maple-cpufreq: remove device tree parsing for cpu nodes
Now that the cpu device registration initialises the of_node(if available) appropriately for all the cpus, parsing here is redundant. This patch removes all DT parsing and uses cpu->of_node instead. Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/maple-cpufreq.c23
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
202static int __init maple_cpufreq_init(void) 202static 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
297bail_noprops: 282bail_noprops:
298 of_node_put(cpunode); 283 of_node_put(cpunode);
299bail_cpus:
300 of_node_put(cpus);
301 284
302 return rc; 285 return rc;
303} 286}