1ca9ab8c2f3bb3e63ccf7c0781df27bdc32f8b9f
[openwrt/staging/hauke.git] / target / linux / mediatek / patches / 0019-thermal-Make-struct-thermal_zone_device_ops-const.patch
1 From 7cbee588bc6eee59c025f89cf9324943fda98934 Mon Sep 17 00:00:00 2001
2 From: Sascha Hauer <s.hauer@pengutronix.de>
3 Date: Wed, 13 May 2015 10:52:38 +0200
4 Subject: [PATCH 19/76] thermal: Make struct thermal_zone_device_ops const
5
6 Now that the of thermal support no longer changes the
7 thermal_zone_device_ops it can be const again.
8
9 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
10 ---
11 Documentation/thermal/sysfs-api.txt | 2 +-
12 drivers/acpi/thermal.c | 2 +-
13 drivers/platform/x86/acerhdf.c | 2 +-
14 drivers/platform/x86/intel_mid_thermal.c | 2 +-
15 drivers/power/power_supply_core.c | 2 +-
16 drivers/thermal/armada_thermal.c | 2 +-
17 drivers/thermal/db8500_thermal.c | 2 +-
18 drivers/thermal/dove_thermal.c | 2 +-
19 drivers/thermal/imx_thermal.c | 2 +-
20 drivers/thermal/int340x_thermal/int3400_thermal.c | 2 +-
21 drivers/thermal/int340x_thermal/int340x_thermal_zone.c | 2 +-
22 drivers/thermal/intel_soc_dts_thermal.c | 2 +-
23 drivers/thermal/kirkwood_thermal.c | 2 +-
24 drivers/thermal/of-thermal.c | 2 +-
25 drivers/thermal/rcar_thermal.c | 2 +-
26 drivers/thermal/spear_thermal.c | 2 +-
27 drivers/thermal/st/st_thermal.c | 2 +-
28 drivers/thermal/thermal_core.c | 2 +-
29 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
30 drivers/thermal/x86_pkg_temp_thermal.c | 2 +-
31 include/linux/thermal.h | 6 +++---
32 21 files changed, 23 insertions(+), 23 deletions(-)
33
34 diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
35 index 87519cb..bb346a2 100644
36 --- a/Documentation/thermal/sysfs-api.txt
37 +++ b/Documentation/thermal/sysfs-api.txt
38 @@ -33,7 +33,7 @@ temperature) and throttle appropriate devices.
39 1.1 thermal zone device interface
40 1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *type,
41 int trips, int mask, void *devdata,
42 - struct thermal_zone_device_ops *ops,
43 + const struct thermal_zone_device_ops *ops,
44 const struct thermal_zone_params *tzp,
45 int passive_delay, int polling_delay))
46
47 diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
48 index 68bff60..6b11462 100644
49 --- a/drivers/acpi/thermal.c
50 +++ b/drivers/acpi/thermal.c
51 @@ -869,7 +869,7 @@ acpi_thermal_unbind_cooling_device(struct thermal_zone_device *thermal,
52 return acpi_thermal_cooling_device_cb(thermal, cdev, false);
53 }
54
55 -static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
56 +static const struct thermal_zone_device_ops acpi_thermal_zone_ops = {
57 .bind = acpi_thermal_bind_cooling_device,
58 .unbind = acpi_thermal_unbind_cooling_device,
59 .get_temp = thermal_get_temp,
60 diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
61 index f2ce63c..bae9ca0 100644
62 --- a/drivers/platform/x86/acerhdf.c
63 +++ b/drivers/platform/x86/acerhdf.c
64 @@ -482,7 +482,7 @@ static int acerhdf_get_crit_temp(struct thermal_zone_device *thermal,
65 }
66
67 /* bind callback functions to thermalzone */
68 -static struct thermal_zone_device_ops acerhdf_dev_ops = {
69 +static const struct thermal_zone_device_ops acerhdf_dev_ops = {
70 .bind = acerhdf_bind,
71 .unbind = acerhdf_unbind,
72 .get_temp = acerhdf_get_ec_temp,
73 diff --git a/drivers/platform/x86/intel_mid_thermal.c b/drivers/platform/x86/intel_mid_thermal.c
74 index 0944e83..069d36b 100644
75 --- a/drivers/platform/x86/intel_mid_thermal.c
76 +++ b/drivers/platform/x86/intel_mid_thermal.c
77 @@ -460,7 +460,7 @@ static int read_curr_temp(struct thermal_zone_device *tzd, unsigned long *temp)
78 }
79
80 /* Can't be const */
81 -static struct thermal_zone_device_ops tzd_ops = {
82 +static const struct thermal_zone_device_ops tzd_ops = {
83 .get_temp = read_curr_temp,
84 };
85
86 diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
87 index 87e2fd1..878cb4e 100644
88 --- a/drivers/power/power_supply_core.c
89 +++ b/drivers/power/power_supply_core.c
90 @@ -509,7 +509,7 @@ static int power_supply_read_temp(struct thermal_zone_device *tzd,
91 return ret;
92 }
93
94 -static struct thermal_zone_device_ops psy_tzd_ops = {
95 +static const struct thermal_zone_device_ops psy_tzd_ops = {
96 .get_temp = power_supply_read_temp,
97 };
98
99 diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
100 index 26b8d32..3f59c8b 100644
101 --- a/drivers/thermal/armada_thermal.c
102 +++ b/drivers/thermal/armada_thermal.c
103 @@ -183,7 +183,7 @@ static int armada_get_temp(struct thermal_zone_device *thermal,
104 return 0;
105 }
106
107 -static struct thermal_zone_device_ops ops = {
108 +static const struct thermal_zone_device_ops ops = {
109 .get_temp = armada_get_temp,
110 };
111
112 diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
113 index b3eca71..38d6aab9 100644
114 --- a/drivers/thermal/db8500_thermal.c
115 +++ b/drivers/thermal/db8500_thermal.c
116 @@ -210,7 +210,7 @@ static int db8500_sys_get_crit_temp(struct thermal_zone_device *thermal,
117 return -EINVAL;
118 }
119
120 -static struct thermal_zone_device_ops thdev_ops = {
121 +static const struct thermal_zone_device_ops thdev_ops = {
122 .bind = db8500_cdev_bind,
123 .unbind = db8500_cdev_unbind,
124 .get_temp = db8500_sys_get_temp,
125 diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
126 index a0bc9de..e8fd627 100644
127 --- a/drivers/thermal/dove_thermal.c
128 +++ b/drivers/thermal/dove_thermal.c
129 @@ -118,7 +118,7 @@ static int dove_get_temp(struct thermal_zone_device *thermal,
130 return 0;
131 }
132
133 -static struct thermal_zone_device_ops ops = {
134 +static const struct thermal_zone_device_ops ops = {
135 .get_temp = dove_get_temp,
136 };
137
138 diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
139 index f1424f0..8a3cfed 100644
140 --- a/drivers/thermal/imx_thermal.c
141 +++ b/drivers/thermal/imx_thermal.c
142 @@ -332,7 +332,7 @@ static int imx_unbind(struct thermal_zone_device *tz,
143 return 0;
144 }
145
146 -static struct thermal_zone_device_ops imx_tz_ops = {
147 +static const struct thermal_zone_device_ops imx_tz_ops = {
148 .bind = imx_bind,
149 .unbind = imx_unbind,
150 .get_temp = imx_get_temp,
151 diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/thermal/int340x_thermal/int3400_thermal.c
152 index 031018e..96bdf8a 100644
153 --- a/drivers/thermal/int340x_thermal/int3400_thermal.c
154 +++ b/drivers/thermal/int340x_thermal/int3400_thermal.c
155 @@ -231,7 +231,7 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal,
156 return result;
157 }
158
159 -static struct thermal_zone_device_ops int3400_thermal_ops = {
160 +static const struct thermal_zone_device_ops int3400_thermal_ops = {
161 .get_temp = int3400_thermal_get_temp,
162 };
163
164 diff --git a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
165 index b9b2666..bd9f9e8 100644
166 --- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
167 +++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
168 @@ -154,7 +154,7 @@ static int int340x_thermal_get_trip_hyst(struct thermal_zone_device *zone,
169 return 0;
170 }
171
172 -static struct thermal_zone_device_ops int340x_thermal_zone_ops = {
173 +static const struct thermal_zone_device_ops int340x_thermal_zone_ops = {
174 .get_temp = int340x_thermal_get_zone_temp,
175 .get_trip_temp = int340x_thermal_get_trip_temp,
176 .get_trip_type = int340x_thermal_get_trip_type,
177 diff --git a/drivers/thermal/intel_soc_dts_thermal.c b/drivers/thermal/intel_soc_dts_thermal.c
178 index fd550b9..625ba6f 100644
179 --- a/drivers/thermal/intel_soc_dts_thermal.c
180 +++ b/drivers/thermal/intel_soc_dts_thermal.c
181 @@ -270,7 +270,7 @@ static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
182 return 0;
183 }
184
185 -static struct thermal_zone_device_ops tzone_ops = {
186 +static const struct thermal_zone_device_ops tzone_ops = {
187 .get_temp = sys_get_curr_temp,
188 .get_trip_temp = sys_get_trip_temp,
189 .get_trip_type = sys_get_trip_type,
190 diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
191 index 11041fe..abba3e2 100644
192 --- a/drivers/thermal/kirkwood_thermal.c
193 +++ b/drivers/thermal/kirkwood_thermal.c
194 @@ -60,7 +60,7 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
195 return 0;
196 }
197
198 -static struct thermal_zone_device_ops ops = {
199 +static const struct thermal_zone_device_ops ops = {
200 .get_temp = kirkwood_get_temp,
201 };
202
203 diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
204 index b9c35bd..bd3185e 100644
205 --- a/drivers/thermal/of-thermal.c
206 +++ b/drivers/thermal/of-thermal.c
207 @@ -365,7 +365,7 @@ static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
208 return -EINVAL;
209 }
210
211 -static struct thermal_zone_device_ops of_thermal_ops = {
212 +static const struct thermal_zone_device_ops of_thermal_ops = {
213 .get_temp = of_thermal_get_temp,
214 .get_trend = of_thermal_get_trend,
215 .set_emul_temp = of_thermal_set_emul_temp,
216 diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
217 index 5d4ae7d..320ceac 100644
218 --- a/drivers/thermal/rcar_thermal.c
219 +++ b/drivers/thermal/rcar_thermal.c
220 @@ -270,7 +270,7 @@ static int rcar_thermal_notify(struct thermal_zone_device *zone,
221 return 0;
222 }
223
224 -static struct thermal_zone_device_ops rcar_thermal_zone_ops = {
225 +static const struct thermal_zone_device_ops rcar_thermal_zone_ops = {
226 .get_temp = rcar_thermal_get_temp,
227 .get_trip_type = rcar_thermal_get_trip_type,
228 .get_trip_temp = rcar_thermal_get_trip_temp,
229 diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
230 index 534dd91..ec07743 100644
231 --- a/drivers/thermal/spear_thermal.c
232 +++ b/drivers/thermal/spear_thermal.c
233 @@ -50,7 +50,7 @@ static inline int thermal_get_temp(struct thermal_zone_device *thermal,
234 return 0;
235 }
236
237 -static struct thermal_zone_device_ops ops = {
238 +static const struct thermal_zone_device_ops ops = {
239 .get_temp = thermal_get_temp,
240 };
241
242 diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c
243 index 44cbba9..0cb5c19 100644
244 --- a/drivers/thermal/st/st_thermal.c
245 +++ b/drivers/thermal/st/st_thermal.c
246 @@ -175,7 +175,7 @@ static int st_thermal_get_trip_temp(struct thermal_zone_device *th,
247 return 0;
248 }
249
250 -static struct thermal_zone_device_ops st_tz_ops = {
251 +static const struct thermal_zone_device_ops st_tz_ops = {
252 .get_temp = st_thermal_get_temp,
253 .get_trip_type = st_thermal_get_trip_type,
254 .get_trip_temp = st_thermal_get_trip_temp,
255 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
256 index 3d8f9f9..6bbf61f 100644
257 --- a/drivers/thermal/thermal_core.c
258 +++ b/drivers/thermal/thermal_core.c
259 @@ -1451,7 +1451,7 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
260 */
261 struct thermal_zone_device *thermal_zone_device_register(const char *type,
262 int trips, int mask, void *devdata,
263 - struct thermal_zone_device_ops *ops,
264 + const struct thermal_zone_device_ops *ops,
265 const struct thermal_zone_params *tzp,
266 int passive_delay, int polling_delay)
267 {
268 diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
269 index ade78eb..e9c82fc 100644
270 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
271 +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
272 @@ -281,7 +281,7 @@ static const struct thermal_zone_of_device_ops ti_of_thermal_ops = {
273 .get_trend = __ti_thermal_get_trend,
274 };
275
276 -static struct thermal_zone_device_ops ti_thermal_ops = {
277 +static const struct thermal_zone_device_ops ti_thermal_ops = {
278 .get_temp = ti_thermal_get_temp,
279 .get_trend = ti_thermal_get_trend,
280 .bind = ti_thermal_bind,
281 diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c
282 index 054c6d45..bb2b975 100644
283 --- a/drivers/thermal/x86_pkg_temp_thermal.c
284 +++ b/drivers/thermal/x86_pkg_temp_thermal.c
285 @@ -274,7 +274,7 @@ static int sys_get_trip_type(struct thermal_zone_device *thermal,
286 }
287
288 /* Thermal zone callback registry */
289 -static struct thermal_zone_device_ops tzone_ops = {
290 +static const struct thermal_zone_device_ops tzone_ops = {
291 .get_temp = sys_get_curr_temp,
292 .get_trip_temp = sys_get_trip_temp,
293 .get_trip_type = sys_get_trip_type,
294 diff --git a/include/linux/thermal.h b/include/linux/thermal.h
295 index 5c6a589..07bd5e8 100644
296 --- a/include/linux/thermal.h
297 +++ b/include/linux/thermal.h
298 @@ -181,7 +181,7 @@ struct thermal_zone_device {
299 int emul_temperature;
300 int passive;
301 unsigned int forced_passive;
302 - struct thermal_zone_device_ops *ops;
303 + const struct thermal_zone_device_ops *ops;
304 const struct thermal_zone_params *tzp;
305 struct thermal_governor *governor;
306 struct list_head thermal_instances;
307 @@ -313,7 +313,7 @@ void thermal_zone_of_sensor_unregister(struct device *dev,
308
309 #if IS_ENABLED(CONFIG_THERMAL)
310 struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
311 - void *, struct thermal_zone_device_ops *,
312 + void *, const struct thermal_zone_device_ops *,
313 const struct thermal_zone_params *, int, int);
314 void thermal_zone_device_unregister(struct thermal_zone_device *);
315
316 @@ -341,7 +341,7 @@ void thermal_notify_framework(struct thermal_zone_device *, int);
317 #else
318 static inline struct thermal_zone_device *thermal_zone_device_register(
319 const char *type, int trips, int mask, void *devdata,
320 - struct thermal_zone_device_ops *ops,
321 + const struct thermal_zone_device_ops *ops,
322 const struct thermal_zone_params *tzp,
323 int passive_delay, int polling_delay)
324 { return ERR_PTR(-ENODEV); }
325 --
326 1.7.10.4
327