kernel: update 4.1 to 4.1.13
[openwrt/openwrt.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 --- a/Documentation/thermal/sysfs-api.txt
35 +++ b/Documentation/thermal/sysfs-api.txt
36 @@ -33,7 +33,7 @@ temperature) and throttle appropriate de
37 1.1 thermal zone device interface
38 1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *type,
39 int trips, int mask, void *devdata,
40 - struct thermal_zone_device_ops *ops,
41 + const struct thermal_zone_device_ops *ops,
42 const struct thermal_zone_params *tzp,
43 int passive_delay, int polling_delay))
44
45 --- a/drivers/acpi/thermal.c
46 +++ b/drivers/acpi/thermal.c
47 @@ -869,7 +869,7 @@ acpi_thermal_unbind_cooling_device(struc
48 return acpi_thermal_cooling_device_cb(thermal, cdev, false);
49 }
50
51 -static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
52 +static const struct thermal_zone_device_ops acpi_thermal_zone_ops = {
53 .bind = acpi_thermal_bind_cooling_device,
54 .unbind = acpi_thermal_unbind_cooling_device,
55 .get_temp = thermal_get_temp,
56 --- a/drivers/platform/x86/acerhdf.c
57 +++ b/drivers/platform/x86/acerhdf.c
58 @@ -482,7 +482,7 @@ static int acerhdf_get_crit_temp(struct
59 }
60
61 /* bind callback functions to thermalzone */
62 -static struct thermal_zone_device_ops acerhdf_dev_ops = {
63 +static const struct thermal_zone_device_ops acerhdf_dev_ops = {
64 .bind = acerhdf_bind,
65 .unbind = acerhdf_unbind,
66 .get_temp = acerhdf_get_ec_temp,
67 --- a/drivers/platform/x86/intel_mid_thermal.c
68 +++ b/drivers/platform/x86/intel_mid_thermal.c
69 @@ -460,7 +460,7 @@ static int read_curr_temp(struct thermal
70 }
71
72 /* Can't be const */
73 -static struct thermal_zone_device_ops tzd_ops = {
74 +static const struct thermal_zone_device_ops tzd_ops = {
75 .get_temp = read_curr_temp,
76 };
77
78 --- a/drivers/power/power_supply_core.c
79 +++ b/drivers/power/power_supply_core.c
80 @@ -535,7 +535,7 @@ static int power_supply_read_temp(struct
81 return ret;
82 }
83
84 -static struct thermal_zone_device_ops psy_tzd_ops = {
85 +static const struct thermal_zone_device_ops psy_tzd_ops = {
86 .get_temp = power_supply_read_temp,
87 };
88
89 --- a/drivers/thermal/armada_thermal.c
90 +++ b/drivers/thermal/armada_thermal.c
91 @@ -183,7 +183,7 @@ static int armada_get_temp(struct therma
92 return 0;
93 }
94
95 -static struct thermal_zone_device_ops ops = {
96 +static const struct thermal_zone_device_ops ops = {
97 .get_temp = armada_get_temp,
98 };
99
100 --- a/drivers/thermal/db8500_thermal.c
101 +++ b/drivers/thermal/db8500_thermal.c
102 @@ -210,7 +210,7 @@ static int db8500_sys_get_crit_temp(stru
103 return -EINVAL;
104 }
105
106 -static struct thermal_zone_device_ops thdev_ops = {
107 +static const struct thermal_zone_device_ops thdev_ops = {
108 .bind = db8500_cdev_bind,
109 .unbind = db8500_cdev_unbind,
110 .get_temp = db8500_sys_get_temp,
111 --- a/drivers/thermal/dove_thermal.c
112 +++ b/drivers/thermal/dove_thermal.c
113 @@ -118,7 +118,7 @@ static int dove_get_temp(struct thermal_
114 return 0;
115 }
116
117 -static struct thermal_zone_device_ops ops = {
118 +static const struct thermal_zone_device_ops ops = {
119 .get_temp = dove_get_temp,
120 };
121
122 --- a/drivers/thermal/imx_thermal.c
123 +++ b/drivers/thermal/imx_thermal.c
124 @@ -332,7 +332,7 @@ static int imx_unbind(struct thermal_zon
125 return 0;
126 }
127
128 -static struct thermal_zone_device_ops imx_tz_ops = {
129 +static const struct thermal_zone_device_ops imx_tz_ops = {
130 .bind = imx_bind,
131 .unbind = imx_unbind,
132 .get_temp = imx_get_temp,
133 --- a/drivers/thermal/int340x_thermal/int3400_thermal.c
134 +++ b/drivers/thermal/int340x_thermal/int3400_thermal.c
135 @@ -231,7 +231,7 @@ static int int3400_thermal_set_mode(stru
136 return result;
137 }
138
139 -static struct thermal_zone_device_ops int3400_thermal_ops = {
140 +static const struct thermal_zone_device_ops int3400_thermal_ops = {
141 .get_temp = int3400_thermal_get_temp,
142 };
143
144 --- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
145 +++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
146 @@ -154,7 +154,7 @@ static int int340x_thermal_get_trip_hyst
147 return 0;
148 }
149
150 -static struct thermal_zone_device_ops int340x_thermal_zone_ops = {
151 +static const struct thermal_zone_device_ops int340x_thermal_zone_ops = {
152 .get_temp = int340x_thermal_get_zone_temp,
153 .get_trip_temp = int340x_thermal_get_trip_temp,
154 .get_trip_type = int340x_thermal_get_trip_type,
155 --- a/drivers/thermal/intel_soc_dts_thermal.c
156 +++ b/drivers/thermal/intel_soc_dts_thermal.c
157 @@ -270,7 +270,7 @@ static int sys_get_curr_temp(struct ther
158 return 0;
159 }
160
161 -static struct thermal_zone_device_ops tzone_ops = {
162 +static const struct thermal_zone_device_ops tzone_ops = {
163 .get_temp = sys_get_curr_temp,
164 .get_trip_temp = sys_get_trip_temp,
165 .get_trip_type = sys_get_trip_type,
166 --- a/drivers/thermal/kirkwood_thermal.c
167 +++ b/drivers/thermal/kirkwood_thermal.c
168 @@ -60,7 +60,7 @@ static int kirkwood_get_temp(struct ther
169 return 0;
170 }
171
172 -static struct thermal_zone_device_ops ops = {
173 +static const struct thermal_zone_device_ops ops = {
174 .get_temp = kirkwood_get_temp,
175 };
176
177 --- a/drivers/thermal/of-thermal.c
178 +++ b/drivers/thermal/of-thermal.c
179 @@ -365,7 +365,7 @@ static int of_thermal_get_crit_temp(stru
180 return -EINVAL;
181 }
182
183 -static struct thermal_zone_device_ops of_thermal_ops = {
184 +static const struct thermal_zone_device_ops of_thermal_ops = {
185 .get_temp = of_thermal_get_temp,
186 .get_trend = of_thermal_get_trend,
187 .set_emul_temp = of_thermal_set_emul_temp,
188 --- a/drivers/thermal/rcar_thermal.c
189 +++ b/drivers/thermal/rcar_thermal.c
190 @@ -270,7 +270,7 @@ static int rcar_thermal_notify(struct th
191 return 0;
192 }
193
194 -static struct thermal_zone_device_ops rcar_thermal_zone_ops = {
195 +static const struct thermal_zone_device_ops rcar_thermal_zone_ops = {
196 .get_temp = rcar_thermal_get_temp,
197 .get_trip_type = rcar_thermal_get_trip_type,
198 .get_trip_temp = rcar_thermal_get_trip_temp,
199 --- a/drivers/thermal/spear_thermal.c
200 +++ b/drivers/thermal/spear_thermal.c
201 @@ -50,7 +50,7 @@ static inline int thermal_get_temp(struc
202 return 0;
203 }
204
205 -static struct thermal_zone_device_ops ops = {
206 +static const struct thermal_zone_device_ops ops = {
207 .get_temp = thermal_get_temp,
208 };
209
210 --- a/drivers/thermal/st/st_thermal.c
211 +++ b/drivers/thermal/st/st_thermal.c
212 @@ -175,7 +175,7 @@ static int st_thermal_get_trip_temp(stru
213 return 0;
214 }
215
216 -static struct thermal_zone_device_ops st_tz_ops = {
217 +static const struct thermal_zone_device_ops st_tz_ops = {
218 .get_temp = st_thermal_get_temp,
219 .get_trip_type = st_thermal_get_trip_type,
220 .get_trip_temp = st_thermal_get_trip_temp,
221 --- a/drivers/thermal/thermal_core.c
222 +++ b/drivers/thermal/thermal_core.c
223 @@ -1451,7 +1451,7 @@ static void remove_trip_attrs(struct the
224 */
225 struct thermal_zone_device *thermal_zone_device_register(const char *type,
226 int trips, int mask, void *devdata,
227 - struct thermal_zone_device_ops *ops,
228 + const struct thermal_zone_device_ops *ops,
229 const struct thermal_zone_params *tzp,
230 int passive_delay, int polling_delay)
231 {
232 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
233 +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
234 @@ -281,7 +281,7 @@ static const struct thermal_zone_of_devi
235 .get_trend = __ti_thermal_get_trend,
236 };
237
238 -static struct thermal_zone_device_ops ti_thermal_ops = {
239 +static const struct thermal_zone_device_ops ti_thermal_ops = {
240 .get_temp = ti_thermal_get_temp,
241 .get_trend = ti_thermal_get_trend,
242 .bind = ti_thermal_bind,
243 --- a/drivers/thermal/x86_pkg_temp_thermal.c
244 +++ b/drivers/thermal/x86_pkg_temp_thermal.c
245 @@ -274,7 +274,7 @@ static int sys_get_trip_type(struct ther
246 }
247
248 /* Thermal zone callback registry */
249 -static struct thermal_zone_device_ops tzone_ops = {
250 +static const struct thermal_zone_device_ops tzone_ops = {
251 .get_temp = sys_get_curr_temp,
252 .get_trip_temp = sys_get_trip_temp,
253 .get_trip_type = sys_get_trip_type,
254 --- a/include/linux/thermal.h
255 +++ b/include/linux/thermal.h
256 @@ -181,7 +181,7 @@ struct thermal_zone_device {
257 int emul_temperature;
258 int passive;
259 unsigned int forced_passive;
260 - struct thermal_zone_device_ops *ops;
261 + const struct thermal_zone_device_ops *ops;
262 const struct thermal_zone_params *tzp;
263 struct thermal_governor *governor;
264 struct list_head thermal_instances;
265 @@ -313,7 +313,7 @@ void thermal_zone_of_sensor_unregister(s
266
267 #if IS_ENABLED(CONFIG_THERMAL)
268 struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
269 - void *, struct thermal_zone_device_ops *,
270 + void *, const struct thermal_zone_device_ops *,
271 const struct thermal_zone_params *, int, int);
272 void thermal_zone_device_unregister(struct thermal_zone_device *);
273
274 @@ -341,7 +341,7 @@ void thermal_notify_framework(struct the
275 #else
276 static inline struct thermal_zone_device *thermal_zone_device_register(
277 const char *type, int trips, int mask, void *devdata,
278 - struct thermal_zone_device_ops *ops,
279 + const struct thermal_zone_device_ops *ops,
280 const struct thermal_zone_params *tzp,
281 int passive_delay, int polling_delay)
282 { return ERR_PTR(-ENODEV); }