diff options
author | Lukasz Majewski <l.majewski@samsung.com> | 2015-02-05 10:45:06 -0500 |
---|---|---|
committer | Lukasz Majewski <l.majewski@samsung.com> | 2015-03-02 04:04:52 -0500 |
commit | 0fc83929d03c2e16cbcf6cf944bd5df8d829847f (patch) | |
tree | 7a5a1d93e6e806eae2b17840ad6c00bfed539ffb /drivers/cpufreq | |
parent | 42b696e808bbea3a4ebf8029e1965d2314612402 (diff) |
cpufreq: exynos: Use simple approach to asses if cpu cooling can be used
Commit: e725d26c4857e5e41975b5e74e64ce6ab09a7121 provided possibility to
use device tree to asses if cpu can be used as cooling device. Since the
code was somewhat awkward, simpler approach has been proposed.
Test HW: Exynos 4412 - Odroid U3.
Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/exynos-cpufreq.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 5e98c6b1f284..82d2fbb20f7e 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c | |||
@@ -159,7 +159,7 @@ static struct cpufreq_driver exynos_driver = { | |||
159 | 159 | ||
160 | static int exynos_cpufreq_probe(struct platform_device *pdev) | 160 | static int exynos_cpufreq_probe(struct platform_device *pdev) |
161 | { | 161 | { |
162 | struct device_node *cpus, *np; | 162 | struct device_node *cpu0; |
163 | int ret = -EINVAL; | 163 | int ret = -EINVAL; |
164 | 164 | ||
165 | exynos_info = kzalloc(sizeof(*exynos_info), GFP_KERNEL); | 165 | exynos_info = kzalloc(sizeof(*exynos_info), GFP_KERNEL); |
@@ -206,28 +206,19 @@ static int exynos_cpufreq_probe(struct platform_device *pdev) | |||
206 | if (ret) | 206 | if (ret) |
207 | goto err_cpufreq_reg; | 207 | goto err_cpufreq_reg; |
208 | 208 | ||
209 | cpus = of_find_node_by_path("/cpus"); | 209 | cpu0 = of_get_cpu_node(0, NULL); |
210 | if (!cpus) { | 210 | if (!cpu0) { |
211 | pr_err("failed to find cpus node\n"); | 211 | pr_err("failed to find cpu0 node\n"); |
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
214 | 214 | ||
215 | np = of_get_next_child(cpus, NULL); | 215 | if (of_find_property(cpu0, "#cooling-cells", NULL)) { |
216 | if (!np) { | 216 | cdev = of_cpufreq_cooling_register(cpu0, |
217 | pr_err("failed to find cpus child node\n"); | ||
218 | of_node_put(cpus); | ||
219 | return 0; | ||
220 | } | ||
221 | |||
222 | if (of_find_property(np, "#cooling-cells", NULL)) { | ||
223 | cdev = of_cpufreq_cooling_register(np, | ||
224 | cpu_present_mask); | 217 | cpu_present_mask); |
225 | if (IS_ERR(cdev)) | 218 | if (IS_ERR(cdev)) |
226 | pr_err("running cpufreq without cooling device: %ld\n", | 219 | pr_err("running cpufreq without cooling device: %ld\n", |
227 | PTR_ERR(cdev)); | 220 | PTR_ERR(cdev)); |
228 | } | 221 | } |
229 | of_node_put(np); | ||
230 | of_node_put(cpus); | ||
231 | 222 | ||
232 | return 0; | 223 | return 0; |
233 | 224 | ||