diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-12 09:30:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-12 09:30:39 -0400 |
commit | 57120fac12321f636c83af447a081d680c0de2e2 (patch) | |
tree | 4b502f4f2b7e15bc012ff8b95884c32372b6687d | |
parent | 8714f8f5fe396ca513ccaaac2304497439c181fb (diff) | |
parent | 5a5e78cd706ce0577ed6356634a34552c866cc10 (diff) |
Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management fixes from Zhang Rui:
- fix an ordering issue in cpu cooling that cooling device is
registered before it's ready (freq_table being populated).
(Lukasz Luba)
- fix a missing comment update (Caesar Wang)
* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
thermal: add the note for set_trip_temp
thermal: cpu_cooling: fix improper order during initialization
-rw-r--r-- | drivers/thermal/cpu_cooling.c | 16 | ||||
-rw-r--r-- | include/linux/thermal.h | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 6ceac4f2d4b2..5b4b47ed948b 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c | |||
@@ -857,14 +857,6 @@ __cpufreq_cooling_register(struct device_node *np, | |||
857 | goto free_power_table; | 857 | goto free_power_table; |
858 | } | 858 | } |
859 | 859 | ||
860 | snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d", | ||
861 | cpufreq_dev->id); | ||
862 | |||
863 | cool_dev = thermal_of_cooling_device_register(np, dev_name, cpufreq_dev, | ||
864 | &cpufreq_cooling_ops); | ||
865 | if (IS_ERR(cool_dev)) | ||
866 | goto remove_idr; | ||
867 | |||
868 | /* Fill freq-table in descending order of frequencies */ | 860 | /* Fill freq-table in descending order of frequencies */ |
869 | for (i = 0, freq = -1; i <= cpufreq_dev->max_level; i++) { | 861 | for (i = 0, freq = -1; i <= cpufreq_dev->max_level; i++) { |
870 | freq = find_next_max(table, freq); | 862 | freq = find_next_max(table, freq); |
@@ -877,6 +869,14 @@ __cpufreq_cooling_register(struct device_node *np, | |||
877 | pr_debug("%s: freq:%u KHz\n", __func__, freq); | 869 | pr_debug("%s: freq:%u KHz\n", __func__, freq); |
878 | } | 870 | } |
879 | 871 | ||
872 | snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d", | ||
873 | cpufreq_dev->id); | ||
874 | |||
875 | cool_dev = thermal_of_cooling_device_register(np, dev_name, cpufreq_dev, | ||
876 | &cpufreq_cooling_ops); | ||
877 | if (IS_ERR(cool_dev)) | ||
878 | goto remove_idr; | ||
879 | |||
880 | cpufreq_dev->clipped_freq = cpufreq_dev->freq_table[0]; | 880 | cpufreq_dev->clipped_freq = cpufreq_dev->freq_table[0]; |
881 | cpufreq_dev->cool_dev = cool_dev; | 881 | cpufreq_dev->cool_dev = cool_dev; |
882 | 882 | ||
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index e45abe7db9a6..ee517bef0db0 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -335,6 +335,8 @@ struct thermal_genl_event { | |||
335 | * @get_trend: a pointer to a function that reads the sensor temperature trend. | 335 | * @get_trend: a pointer to a function that reads the sensor temperature trend. |
336 | * @set_emul_temp: a pointer to a function that sets sensor emulated | 336 | * @set_emul_temp: a pointer to a function that sets sensor emulated |
337 | * temperature. | 337 | * temperature. |
338 | * @set_trip_temp: a pointer to a function that sets the trip temperature on | ||
339 | * hardware. | ||
338 | */ | 340 | */ |
339 | struct thermal_zone_of_device_ops { | 341 | struct thermal_zone_of_device_ops { |
340 | int (*get_temp)(void *, int *); | 342 | int (*get_temp)(void *, int *); |