diff options
| -rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 9 | ||||
| -rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 7 |
2 files changed, 13 insertions, 3 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 | } |
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 3e396543aea4..c3fd2a101ca0 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/clk.h> | 9 | #include <linux/clk.h> |
| 10 | #include <linux/cpu.h> | ||
| 10 | #include <linux/cpufreq.h> | 11 | #include <linux/cpufreq.h> |
| 11 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
| 12 | #include <linux/err.h> | 13 | #include <linux/err.h> |
| @@ -202,7 +203,11 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) | |||
| 202 | unsigned long min_volt, max_volt; | 203 | unsigned long min_volt, max_volt; |
| 203 | int num, ret; | 204 | int num, ret; |
| 204 | 205 | ||
| 205 | cpu_dev = &pdev->dev; | 206 | cpu_dev = get_cpu_device(0); |
| 207 | if (!cpu_dev) { | ||
| 208 | pr_err("failed to get cpu0 device\n"); | ||
| 209 | return -ENODEV; | ||
| 210 | } | ||
| 206 | 211 | ||
| 207 | np = of_node_get(cpu_dev->of_node); | 212 | np = of_node_get(cpu_dev->of_node); |
| 208 | if (!np) { | 213 | if (!np) { |
