diff options
author | Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | 2013-09-10 13:59:47 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-18 21:53:43 -0400 |
commit | b494b48dacb4dd848d76bc8871e55716486f0253 (patch) | |
tree | 44d122a8bcf5d596578d9e97fdef92525cb40ede /arch | |
parent | e1825b25309264bf2d1275a8da9c997bca39b0d8 (diff) |
cpufreq: imx6q-cpufreq: assign cpu_dev correctly to cpu0 device
Commit cdc58d602d2e657602a90c190cbf745886c95977 "cpufreq: imx6q-cpufreq:
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-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: 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 'arch')
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 85a1b51346c8..90372a21087f 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -233,10 +233,15 @@ put_node: | |||
233 | of_node_put(np); | 233 | of_node_put(np); |
234 | } | 234 | } |
235 | 235 | ||
236 | static void __init imx6q_opp_init(struct device *cpu_dev) | 236 | static void __init imx6q_opp_init(void) |
237 | { | 237 | { |
238 | struct device_node *np; | 238 | struct device_node *np; |
239 | struct device *cpu_dev = get_cpu_device(0); | ||
239 | 240 | ||
241 | if (!cpu_dev) { | ||
242 | pr_warn("failed to get cpu0 device\n"); | ||
243 | return; | ||
244 | } | ||
240 | np = of_node_get(cpu_dev->of_node); | 245 | np = of_node_get(cpu_dev->of_node); |
241 | if (!np) { | 246 | if (!np) { |
242 | pr_warn("failed to find cpu0 node\n"); | 247 | pr_warn("failed to find cpu0 node\n"); |
@@ -268,7 +273,7 @@ static void __init imx6q_init_late(void) | |||
268 | imx6q_cpuidle_init(); | 273 | imx6q_cpuidle_init(); |
269 | 274 | ||
270 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { | 275 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { |
271 | imx6q_opp_init(&imx6q_cpufreq_pdev.dev); | 276 | imx6q_opp_init(); |
272 | platform_device_register(&imx6q_cpufreq_pdev); | 277 | platform_device_register(&imx6q_cpufreq_pdev); |
273 | } | 278 | } |
274 | } | 279 | } |