@@ -14,6 +14,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/clk.h>
+#include <linux/cpu.h>
#include <linux/cpufreq.h>
#include <linux/err.h>
#include <linux/init.h>
@@ -218,12 +219,19 @@ static struct cpufreq_driver spear_cpufreq_driver = {
static int spear_cpufreq_driver_init(void)
{
struct device_node *np;
+ struct device *cpu_dev;
const struct property *prop;
struct cpufreq_frequency_table *freq_tbl;
const __be32 *val;
int cnt, i, ret;
- np = of_find_node_by_path("/cpus/cpu@0");
+ cpu_dev = get_cpu_device(0);
+ if (!cpu_dev) {
+ pr_err("failed to get cpu device\n");
+ return -ENODEV;
+ }
+
+ np = of_node_get(cpu_dev->of_node);
if (!np) {
pr_err("No cpu node found");
return -ENODEV;