aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2012-07-24 04:56:21 -0400
committerZhang Rui <rui.zhang@intel.com>2012-09-24 02:44:37 -0400
commitf4a821ce6ed41970d0155f55067fb07009974fbe (patch)
tree6cceeaa90060fb17985fbe7f9b5aa9466cf03d8d /include
parent908b9fb792b77663a007af240e7ee89460de2025 (diff)
Thermal: Introduce locking for cdev.thermal_instances list.
we need to go over all the thermal_instance list of a cooling device to decide which cooling state to put the cooling device to. But at this time, as a cooling device may be referenced in multiple thermal zones, we need to lock the list first in case another thermal zone is updating this cooling device. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/thermal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 76d0fe88eb1c..91b34812cd84 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -95,6 +95,7 @@ struct thermal_cooling_device {
95 void *devdata; 95 void *devdata;
96 const struct thermal_cooling_device_ops *ops; 96 const struct thermal_cooling_device_ops *ops;
97 bool updated; /* true if the cooling device does not need update */ 97 bool updated; /* true if the cooling device does not need update */
98 struct mutex lock; /* protect thermal_instances list */
98 struct list_head thermal_instances; 99 struct list_head thermal_instances;
99 struct list_head node; 100 struct list_head node;
100}; 101};