diff options
author | Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | 2013-09-10 13:59:46 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-18 21:53:43 -0400 |
commit | e1825b25309264bf2d1275a8da9c997bca39b0d8 (patch) | |
tree | 65b6acea9440901eab1782631e77be1c7ef2f4a7 /drivers | |
parent | 8efd57657d8ef666810b55e609da72de92314dc4 (diff) |
cpufreq: cpufreq-cpu0: assign cpu_dev correctly to cpu0 device
Commit f837a9b5ab05c52a07108c6f09ca66f2e0aee757 "cpufreq: cpufreq-cpu0:
remove device tree parsing for cpu nodes" assumed the pdev->dev is set to
cpu0 device in the platform code. But it actually points to the virtual
cpufreq-cpu0 platform device which is not present in the device tree.
Most of the information needed by cpufreq is stored in cpu0 DT node.
So cpu_dev must point to cpu0 device.
This patch fixes the wrong assignment to cpu_dev.
Reported-and-tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq-cpu0.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index cbfffa91ebdd..78c49d8e0f4a 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
13 | 13 | ||
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/cpu.h> | ||
15 | #include <linux/cpufreq.h> | 16 | #include <linux/cpufreq.h> |
16 | #include <linux/err.h> | 17 | #include <linux/err.h> |
17 | #include <linux/module.h> | 18 | #include <linux/module.h> |
@@ -177,7 +178,11 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) | |||
177 | struct device_node *np; | 178 | struct device_node *np; |
178 | int ret; | 179 | int ret; |
179 | 180 | ||
180 | cpu_dev = &pdev->dev; | 181 | cpu_dev = get_cpu_device(0); |
182 | if (!cpu_dev) { | ||
183 | pr_err("failed to get cpu0 device\n"); | ||
184 | return -ENODEV; | ||
185 | } | ||
181 | 186 | ||
182 | np = of_node_get(cpu_dev->of_node); | 187 | np = of_node_get(cpu_dev->of_node); |
183 | if (!np) { | 188 | if (!np) { |