From: Park Chungwoo Date: Thu, 17 Mar 2016 02:58:51 +0000 (+0900) Subject: thermal: exynos: Modify multi thermal zone register code. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a60d3f4bb141abb049282f3849a4b8f4f942ac33;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git thermal: exynos: Modify multi thermal zone register code. Change-Id: I39164f0d2c7f1f257328f48040975ed73fbd0807 Signed-off-by: Park Chungwoo Signed-off-by: Hyeonseong Gil --- diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index df885203c0bf..8e93882f017e 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1482,18 +1482,22 @@ static const struct thermal_zone_of_device_ops exynos_sensor_ops = { static int exynos_cpufreq_cooling_register(struct exynos_tmu_data *data) { - struct device_node *np, *child, *gchild, *ggchild; + struct device_node *np, *child = NULL, *gchild, *ggchild; struct device_node *cool_np; struct of_phandle_args cooling_spec; struct cpumask mask_val; - int cpu, ret; + int cpu, ret, i; np = of_find_node_by_name(NULL, "thermal-zones"); if (!np) return -ENODEV; - /* Regist cpufreq cooling register */ - child = of_get_next_child(np, NULL); + /* Regist cpufreq cooling device */ + for (i = 0; i <= data->id; i++) { + child = of_get_next_child(np, child); + if (i == data->id) + break; + } gchild = of_get_child_by_name(child, "cooling-maps"); ggchild = of_get_next_child(gchild, NULL); ret = of_parse_phandle_with_args(ggchild, "cooling-device", "#cooling-cells", @@ -1504,7 +1508,7 @@ static int exynos_cpufreq_cooling_register(struct exynos_tmu_data *data) cool_np = cooling_spec.np; for_each_possible_cpu(cpu) { - if (cpu_topology[cpu].cluster_id == 0) { + if (cpu_topology[cpu].cluster_id == data->id) { cpumask_copy(&mask_val, topology_core_cpumask(cpu)); } }