Commit da0eb143 authored by Sudeep KarkadaNagesha's avatar Sudeep KarkadaNagesha

cpufreq: arm_big_little: 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.
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
parent e768f350
...@@ -19,12 +19,11 @@ ...@@ -19,12 +19,11 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/cpu.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of_device.h>
#include <linux/opp.h> #include <linux/opp.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -34,27 +33,13 @@ ...@@ -34,27 +33,13 @@
/* get cpu node with valid operating-points */ /* get cpu node with valid operating-points */
static struct device_node *get_cpu_node_with_valid_op(int cpu) static struct device_node *get_cpu_node_with_valid_op(int cpu)
{ {
struct device_node *np = NULL, *parent; struct device_node *np = of_cpu_device_node_get(cpu);
int count = 0;
parent = of_find_node_by_path("/cpus"); if (!of_get_property(np, "operating-points", NULL)) {
if (!parent) { of_node_put(np);
pr_err("failed to find OF /cpus\n"); np = NULL;
return NULL;
} }
for_each_child_of_node(parent, np) {
if (count++ != cpu)
continue;
if (!of_get_property(np, "operating-points", NULL)) {
of_node_put(np);
np = NULL;
}
break;
}
of_node_put(parent);
return np; return np;
} }
...@@ -63,11 +48,12 @@ static int dt_init_opp_table(struct device *cpu_dev) ...@@ -63,11 +48,12 @@ static int dt_init_opp_table(struct device *cpu_dev)
struct device_node *np; struct device_node *np;
int ret; int ret;
np = get_cpu_node_with_valid_op(cpu_dev->id); np = of_node_get(cpu_dev->of_node);
if (!np) if (!np) {
return -ENODATA; pr_err("failed to find cpu%d node\n", cpu_dev->id);
return -ENOENT;
}
cpu_dev->of_node = np;
ret = of_init_opp_table(cpu_dev); ret = of_init_opp_table(cpu_dev);
of_node_put(np); of_node_put(np);
...@@ -79,9 +65,11 @@ static int dt_get_transition_latency(struct device *cpu_dev) ...@@ -79,9 +65,11 @@ static int dt_get_transition_latency(struct device *cpu_dev)
struct device_node *np; struct device_node *np;
u32 transition_latency = CPUFREQ_ETERNAL; u32 transition_latency = CPUFREQ_ETERNAL;
np = get_cpu_node_with_valid_op(cpu_dev->id); np = of_node_get(cpu_dev->of_node);
if (!np) if (!np) {
pr_info("Failed to find cpu node. Use CPUFREQ_ETERNAL transition latency\n");
return CPUFREQ_ETERNAL; return CPUFREQ_ETERNAL;
}
of_property_read_u32(np, "clock-latency", &transition_latency); of_property_read_u32(np, "clock-latency", &transition_latency);
of_node_put(np); of_node_put(np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment