diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-07-28 16:48:42 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-08-02 14:51:57 -0400 |
commit | 31f5396ad3bde23c8416e8d23ba425e27f413314 (patch) | |
tree | 923ec07b9afff6cf952cbc2bd5f26bf490793c6f /include/linux/thermal.h | |
parent | 0d97d7a494d43be77f57e688369be0aae33d1ade (diff) |
thermal: make THERMAL_HWMON implementation fully internal
THERMAL_HWMON is implemented inside the thermal_sys driver and has no
effect on drivers implementing thermal zones, so they shouldn't see
anything related to it in <linux/thermal.h>. Making the THERMAL_HWMON
implementation fully internal has two advantages beyond the cleaner
design:
* This avoids rebuilding all thermal drivers if the THERMAL_HWMON
implementation changes, or if CONFIG_THERMAL_HWMON gets enabled or
disabled.
* This avoids breaking the thermal kABI in these cases too, which should
make distributions happy.
The only drawback I can see is slightly higher memory fragmentation, as
the number of kzalloc() calls will increase by one per thermal zone. But
I doubt it will be a problem in practice, as I've never seen a system with
more than two thermal zones.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rene Herman <rene.herman@gmail.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index d3ec89fb4122..47b4a27e6e97 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -85,22 +85,6 @@ struct thermal_cooling_device { | |||
85 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) | 85 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) |
86 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) | 86 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) |
87 | 87 | ||
88 | #if defined(CONFIG_THERMAL_HWMON) | ||
89 | /* thermal zone devices with the same type share one hwmon device */ | ||
90 | struct thermal_hwmon_device { | ||
91 | char type[THERMAL_NAME_LENGTH]; | ||
92 | struct device *device; | ||
93 | int count; | ||
94 | struct list_head tz_list; | ||
95 | struct list_head node; | ||
96 | }; | ||
97 | |||
98 | struct thermal_hwmon_attr { | ||
99 | struct device_attribute attr; | ||
100 | char name[16]; | ||
101 | }; | ||
102 | #endif | ||
103 | |||
104 | struct thermal_zone_device { | 88 | struct thermal_zone_device { |
105 | int id; | 89 | int id; |
106 | char type[THERMAL_NAME_LENGTH]; | 90 | char type[THERMAL_NAME_LENGTH]; |
@@ -120,12 +104,6 @@ struct thermal_zone_device { | |||
120 | struct mutex lock; /* protect cooling devices list */ | 104 | struct mutex lock; /* protect cooling devices list */ |
121 | struct list_head node; | 105 | struct list_head node; |
122 | struct delayed_work poll_queue; | 106 | struct delayed_work poll_queue; |
123 | #if defined(CONFIG_THERMAL_HWMON) | ||
124 | struct list_head hwmon_node; | ||
125 | struct thermal_hwmon_device *hwmon; | ||
126 | struct thermal_hwmon_attr temp_input; /* hwmon sys attr */ | ||
127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ | ||
128 | #endif | ||
129 | }; | 107 | }; |
130 | /* Adding event notification support elements */ | 108 | /* Adding event notification support elements */ |
131 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | 109 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" |