mediatek: add support for the new MT7623 Arm SoC
[openwrt/openwrt.git] / target / linux / mediatek / patches / 0010-thermal-consistently-use-int-for-temperatures.patch
1 From 29e6031548373b9e7ec0c17e85da6a4cf4fee7f5 Mon Sep 17 00:00:00 2001
2 From: Sascha Hauer <s.hauer@pengutronix.de>
3 Date: Wed, 13 May 2015 10:52:29 +0200
4 Subject: [PATCH 10/76] thermal: consistently use int for temperatures
5
6 The thermal code uses int, long and unsigned long for temperatures
7 in different places. Using an unsigned type limits the thermal framework
8 to positive temperatures without need. 'long' is 64bit on several
9 architectures which is not needed. Consistently use a plain 'int'
10 for temperatures.
11
12 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
13 ---
14 drivers/acpi/thermal.c | 12 ++++-----
15 drivers/hwmon/lm75.c | 2 +-
16 drivers/hwmon/ntc_thermistor.c | 2 +-
17 drivers/hwmon/tmp102.c | 2 +-
18 drivers/input/touchscreen/sun4i-ts.c | 8 +++---
19 drivers/platform/x86/acerhdf.c | 9 +++----
20 drivers/power/power_supply_core.c | 2 +-
21 drivers/thermal/armada_thermal.c | 2 +-
22 drivers/thermal/db8500_thermal.c | 7 +++--
23 drivers/thermal/dove_thermal.c | 2 +-
24 drivers/thermal/fair_share.c | 2 +-
25 drivers/thermal/gov_bang_bang.c | 5 ++--
26 drivers/thermal/imx_thermal.c | 27 ++++++++++----------
27 .../thermal/int340x_thermal/int340x_thermal_zone.c | 10 ++++----
28 .../thermal/int340x_thermal/int340x_thermal_zone.h | 8 +++---
29 drivers/thermal/intel_soc_dts_thermal.c | 7 +++--
30 drivers/thermal/of-thermal.c | 14 +++++-----
31 drivers/thermal/rcar_thermal.c | 7 +++--
32 drivers/thermal/rockchip_thermal.c | 10 ++++----
33 drivers/thermal/samsung/exynos_tmu.c | 19 +++++++-------
34 drivers/thermal/spear_thermal.c | 2 +-
35 drivers/thermal/st/st_thermal.c | 5 ++--
36 drivers/thermal/step_wise.c | 4 +--
37 drivers/thermal/tegra_soctherm.c | 4 +--
38 drivers/thermal/thermal_core.c | 26 +++++++++----------
39 drivers/thermal/thermal_hwmon.c | 10 ++++----
40 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 10 ++++----
41 drivers/thermal/x86_pkg_temp_thermal.c | 10 ++++----
42 include/linux/thermal.h | 26 ++++++++-----------
43 29 files changed, 120 insertions(+), 134 deletions(-)
44
45 diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
46 index d24fa19..68bff60 100644
47 --- a/drivers/acpi/thermal.c
48 +++ b/drivers/acpi/thermal.c
49 @@ -529,8 +529,7 @@ static void acpi_thermal_check(void *data)
50
51 /* sys I/F for generic thermal sysfs support */
52
53 -static int thermal_get_temp(struct thermal_zone_device *thermal,
54 - unsigned long *temp)
55 +static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
56 {
57 struct acpi_thermal *tz = thermal->devdata;
58 int result;
59 @@ -637,7 +636,7 @@ static int thermal_get_trip_type(struct thermal_zone_device *thermal,
60 }
61
62 static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
63 - int trip, unsigned long *temp)
64 + int trip, int *temp)
65 {
66 struct acpi_thermal *tz = thermal->devdata;
67 int i;
68 @@ -690,7 +689,8 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
69 }
70
71 static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
72 - unsigned long *temperature) {
73 + int *temperature)
74 +{
75 struct acpi_thermal *tz = thermal->devdata;
76
77 if (tz->trips.critical.flags.valid) {
78 @@ -713,8 +713,8 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
79 return -EINVAL;
80
81 if (type == THERMAL_TRIP_ACTIVE) {
82 - unsigned long trip_temp;
83 - unsigned long temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
84 + int trip_temp;
85 + int temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
86 tz->temperature, tz->kelvin_offset);
87 if (thermal_get_trip_temp(thermal, trip, &trip_temp))
88 return -EINVAL;
89 diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
90 index fe41d5a..e4e57bb 100644
91 --- a/drivers/hwmon/lm75.c
92 +++ b/drivers/hwmon/lm75.c
93 @@ -104,7 +104,7 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
94
95 /* sysfs attributes for hwmon */
96
97 -static int lm75_read_temp(void *dev, long *temp)
98 +static int lm75_read_temp(void *dev, int *temp)
99 {
100 struct lm75_data *data = lm75_update_device(dev);
101
102 diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
103 index 6880011..3d9eab9 100644
104 --- a/drivers/hwmon/ntc_thermistor.c
105 +++ b/drivers/hwmon/ntc_thermistor.c
106 @@ -439,7 +439,7 @@ static int ntc_thermistor_get_ohm(struct ntc_data *data)
107 return -EINVAL;
108 }
109
110 -static int ntc_read_temp(void *dev, long *temp)
111 +static int ntc_read_temp(void *dev, int *temp)
112 {
113 struct ntc_data *data = dev_get_drvdata(dev);
114 int ohm;
115 diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c
116 index 9da2735..6548262 100644
117 --- a/drivers/hwmon/tmp102.c
118 +++ b/drivers/hwmon/tmp102.c
119 @@ -98,7 +98,7 @@ static struct tmp102 *tmp102_update_device(struct device *dev)
120 return tmp102;
121 }
122
123 -static int tmp102_read_temp(void *dev, long *temp)
124 +static int tmp102_read_temp(void *dev, int *temp)
125 {
126 struct tmp102 *tmp102 = tmp102_update_device(dev);
127
128 diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
129 index c011699..4857943 100644
130 --- a/drivers/input/touchscreen/sun4i-ts.c
131 +++ b/drivers/input/touchscreen/sun4i-ts.c
132 @@ -191,7 +191,7 @@ static void sun4i_ts_close(struct input_dev *dev)
133 writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC);
134 }
135
136 -static int sun4i_get_temp(const struct sun4i_ts_data *ts, long *temp)
137 +static int sun4i_get_temp(const struct sun4i_ts_data *ts, int *temp)
138 {
139 /* No temp_data until the first irq */
140 if (ts->temp_data == -1)
141 @@ -202,7 +202,7 @@ static int sun4i_get_temp(const struct sun4i_ts_data *ts, long *temp)
142 return 0;
143 }
144
145 -static int sun4i_get_tz_temp(void *data, long *temp)
146 +static int sun4i_get_tz_temp(void *data, int *temp)
147 {
148 return sun4i_get_temp(data, temp);
149 }
150 @@ -215,14 +215,14 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
151 char *buf)
152 {
153 struct sun4i_ts_data *ts = dev_get_drvdata(dev);
154 - long temp;
155 + int temp;
156 int error;
157
158 error = sun4i_get_temp(ts, &temp);
159 if (error)
160 return error;
161
162 - return sprintf(buf, "%ld\n", temp);
163 + return sprintf(buf, "%d\n", temp);
164 }
165
166 static ssize_t show_temp_label(struct device *dev,
167 diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
168 index 594c918..f2ce63c 100644
169 --- a/drivers/platform/x86/acerhdf.c
170 +++ b/drivers/platform/x86/acerhdf.c
171 @@ -346,8 +346,7 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal)
172 * as late as the polling interval is since we can't do that in the respective
173 * accessors of the module parameters.
174 */
175 -static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal,
176 - unsigned long *t)
177 +static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal, int *t)
178 {
179 int temp, err = 0;
180
181 @@ -452,7 +451,7 @@ static int acerhdf_get_trip_type(struct thermal_zone_device *thermal, int trip,
182 }
183
184 static int acerhdf_get_trip_hyst(struct thermal_zone_device *thermal, int trip,
185 - unsigned long *temp)
186 + int *temp)
187 {
188 if (trip != 0)
189 return -EINVAL;
190 @@ -463,7 +462,7 @@ static int acerhdf_get_trip_hyst(struct thermal_zone_device *thermal, int trip,
191 }
192
193 static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
194 - unsigned long *temp)
195 + int *temp)
196 {
197 if (trip == 0)
198 *temp = fanon;
199 @@ -476,7 +475,7 @@ static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
200 }
201
202 static int acerhdf_get_crit_temp(struct thermal_zone_device *thermal,
203 - unsigned long *temperature)
204 + int *temperature)
205 {
206 *temperature = ACERHDF_TEMP_CRIT;
207 return 0;
208 diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
209 index 2ed4a4a..87e2fd1 100644
210 --- a/drivers/power/power_supply_core.c
211 +++ b/drivers/power/power_supply_core.c
212 @@ -492,7 +492,7 @@ EXPORT_SYMBOL_GPL(power_supply_unreg_notifier);
213
214 #ifdef CONFIG_THERMAL
215 static int power_supply_read_temp(struct thermal_zone_device *tzd,
216 - unsigned long *temp)
217 + int *temp)
218 {
219 struct power_supply *psy;
220 union power_supply_propval val;
221 diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
222 index 01255fd..26b8d32 100644
223 --- a/drivers/thermal/armada_thermal.c
224 +++ b/drivers/thermal/armada_thermal.c
225 @@ -155,7 +155,7 @@ static bool armada_is_valid(struct armada_thermal_priv *priv)
226 }
227
228 static int armada_get_temp(struct thermal_zone_device *thermal,
229 - unsigned long *temp)
230 + int *temp)
231 {
232 struct armada_thermal_priv *priv = thermal->devdata;
233 unsigned long reg;
234 diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
235 index 20adfbe..b3eca71 100644
236 --- a/drivers/thermal/db8500_thermal.c
237 +++ b/drivers/thermal/db8500_thermal.c
238 @@ -107,8 +107,7 @@ static int db8500_cdev_unbind(struct thermal_zone_device *thermal,
239 }
240
241 /* Callback to get current temperature */
242 -static int db8500_sys_get_temp(struct thermal_zone_device *thermal,
243 - unsigned long *temp)
244 +static int db8500_sys_get_temp(struct thermal_zone_device *thermal, int *temp)
245 {
246 struct db8500_thermal_zone *pzone = thermal->devdata;
247
248 @@ -180,7 +179,7 @@ static int db8500_sys_get_trip_type(struct thermal_zone_device *thermal,
249
250 /* Callback to get trip point temperature */
251 static int db8500_sys_get_trip_temp(struct thermal_zone_device *thermal,
252 - int trip, unsigned long *temp)
253 + int trip, int *temp)
254 {
255 struct db8500_thermal_zone *pzone = thermal->devdata;
256 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab;
257 @@ -195,7 +194,7 @@ static int db8500_sys_get_trip_temp(struct thermal_zone_device *thermal,
258
259 /* Callback to get critical trip point temperature */
260 static int db8500_sys_get_crit_temp(struct thermal_zone_device *thermal,
261 - unsigned long *temp)
262 + int *temp)
263 {
264 struct db8500_thermal_zone *pzone = thermal->devdata;
265 struct db8500_thsens_platform_data *ptrips = pzone->trip_tab;
266 diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
267 index 09f6e30..a0bc9de 100644
268 --- a/drivers/thermal/dove_thermal.c
269 +++ b/drivers/thermal/dove_thermal.c
270 @@ -93,7 +93,7 @@ static int dove_init_sensor(const struct dove_thermal_priv *priv)
271 }
272
273 static int dove_get_temp(struct thermal_zone_device *thermal,
274 - unsigned long *temp)
275 + int *temp)
276 {
277 unsigned long reg;
278 struct dove_thermal_priv *priv = thermal->devdata;
279 diff --git a/drivers/thermal/fair_share.c b/drivers/thermal/fair_share.c
280 index 6e0a3fb..efad70e 100644
281 --- a/drivers/thermal/fair_share.c
282 +++ b/drivers/thermal/fair_share.c
283 @@ -34,7 +34,7 @@
284 static int get_trip_level(struct thermal_zone_device *tz)
285 {
286 int count = 0;
287 - unsigned long trip_temp;
288 + int trip_temp;
289 enum thermal_trip_type trip_type;
290
291 if (tz->trips == 0 || !tz->ops->get_trip_temp)
292 diff --git a/drivers/thermal/gov_bang_bang.c b/drivers/thermal/gov_bang_bang.c
293 index c5dd76b..70836c5 100644
294 --- a/drivers/thermal/gov_bang_bang.c
295 +++ b/drivers/thermal/gov_bang_bang.c
296 @@ -25,14 +25,13 @@
297
298 static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
299 {
300 - long trip_temp;
301 - unsigned long trip_hyst;
302 + int trip_temp, trip_hyst;
303 struct thermal_instance *instance;
304
305 tz->ops->get_trip_temp(tz, trip, &trip_temp);
306 tz->ops->get_trip_hyst(tz, trip, &trip_hyst);
307
308 - dev_dbg(&tz->device, "Trip%d[temp=%ld]:temp=%d:hyst=%ld\n",
309 + dev_dbg(&tz->device, "Trip%d[temp=%d]:temp=%d:hyst=%d\n",
310 trip, trip_temp, tz->temperature,
311 trip_hyst);
312
313 diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
314 index 2ccbc07..f1424f0 100644
315 --- a/drivers/thermal/imx_thermal.c
316 +++ b/drivers/thermal/imx_thermal.c
317 @@ -98,10 +98,10 @@ struct imx_thermal_data {
318 enum thermal_device_mode mode;
319 struct regmap *tempmon;
320 u32 c1, c2; /* See formula in imx_get_sensor_data() */
321 - unsigned long temp_passive;
322 - unsigned long temp_critical;
323 - unsigned long alarm_temp;
324 - unsigned long last_temp;
325 + int temp_passive;
326 + int temp_critical;
327 + int alarm_temp;
328 + int last_temp;
329 bool irq_enabled;
330 int irq;
331 struct clk *thermal_clk;
332 @@ -109,7 +109,7 @@ struct imx_thermal_data {
333 };
334
335 static void imx_set_panic_temp(struct imx_thermal_data *data,
336 - signed long panic_temp)
337 + int panic_temp)
338 {
339 struct regmap *map = data->tempmon;
340 int critical_value;
341 @@ -121,7 +121,7 @@ static void imx_set_panic_temp(struct imx_thermal_data *data,
342 }
343
344 static void imx_set_alarm_temp(struct imx_thermal_data *data,
345 - signed long alarm_temp)
346 + int alarm_temp)
347 {
348 struct regmap *map = data->tempmon;
349 int alarm_value;
350 @@ -133,7 +133,7 @@ static void imx_set_alarm_temp(struct imx_thermal_data *data,
351 TEMPSENSE0_ALARM_VALUE_SHIFT);
352 }
353
354 -static int imx_get_temp(struct thermal_zone_device *tz, unsigned long *temp)
355 +static int imx_get_temp(struct thermal_zone_device *tz, int *temp)
356 {
357 struct imx_thermal_data *data = tz->devdata;
358 struct regmap *map = data->tempmon;
359 @@ -189,13 +189,13 @@ static int imx_get_temp(struct thermal_zone_device *tz, unsigned long *temp)
360 if (data->alarm_temp == data->temp_critical &&
361 *temp < data->temp_passive) {
362 imx_set_alarm_temp(data, data->temp_passive);
363 - dev_dbg(&tz->device, "thermal alarm off: T < %lu\n",
364 + dev_dbg(&tz->device, "thermal alarm off: T < %d\n",
365 data->alarm_temp / 1000);
366 }
367 }
368
369 if (*temp != data->last_temp) {
370 - dev_dbg(&tz->device, "millicelsius: %ld\n", *temp);
371 + dev_dbg(&tz->device, "millicelsius: %d\n", *temp);
372 data->last_temp = *temp;
373 }
374
375 @@ -262,8 +262,7 @@ static int imx_get_trip_type(struct thermal_zone_device *tz, int trip,
376 return 0;
377 }
378
379 -static int imx_get_crit_temp(struct thermal_zone_device *tz,
380 - unsigned long *temp)
381 +static int imx_get_crit_temp(struct thermal_zone_device *tz, int *temp)
382 {
383 struct imx_thermal_data *data = tz->devdata;
384
385 @@ -272,7 +271,7 @@ static int imx_get_crit_temp(struct thermal_zone_device *tz,
386 }
387
388 static int imx_get_trip_temp(struct thermal_zone_device *tz, int trip,
389 - unsigned long *temp)
390 + int *temp)
391 {
392 struct imx_thermal_data *data = tz->devdata;
393
394 @@ -282,7 +281,7 @@ static int imx_get_trip_temp(struct thermal_zone_device *tz, int trip,
395 }
396
397 static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip,
398 - unsigned long temp)
399 + int temp)
400 {
401 struct imx_thermal_data *data = tz->devdata;
402
403 @@ -433,7 +432,7 @@ static irqreturn_t imx_thermal_alarm_irq_thread(int irq, void *dev)
404 {
405 struct imx_thermal_data *data = dev;
406
407 - dev_dbg(&data->tz->device, "THERMAL ALARM: T > %lu\n",
408 + dev_dbg(&data->tz->device, "THERMAL ALARM: T > %d\n",
409 data->alarm_temp / 1000);
410
411 thermal_zone_device_update(data->tz);
412 diff --git a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
413 index 1e25133..b9b2666 100644
414 --- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
415 +++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
416 @@ -20,7 +20,7 @@
417 #include "int340x_thermal_zone.h"
418
419 static int int340x_thermal_get_zone_temp(struct thermal_zone_device *zone,
420 - unsigned long *temp)
421 + int *temp)
422 {
423 struct int34x_thermal_zone *d = zone->devdata;
424 unsigned long long tmp;
425 @@ -49,7 +49,7 @@ static int int340x_thermal_get_zone_temp(struct thermal_zone_device *zone,
426 }
427
428 static int int340x_thermal_get_trip_temp(struct thermal_zone_device *zone,
429 - int trip, unsigned long *temp)
430 + int trip, int *temp)
431 {
432 struct int34x_thermal_zone *d = zone->devdata;
433 int i;
434 @@ -114,7 +114,7 @@ static int int340x_thermal_get_trip_type(struct thermal_zone_device *zone,
435 }
436
437 static int int340x_thermal_set_trip_temp(struct thermal_zone_device *zone,
438 - int trip, unsigned long temp)
439 + int trip, int temp)
440 {
441 struct int34x_thermal_zone *d = zone->devdata;
442 acpi_status status;
443 @@ -136,7 +136,7 @@ static int int340x_thermal_set_trip_temp(struct thermal_zone_device *zone,
444
445
446 static int int340x_thermal_get_trip_hyst(struct thermal_zone_device *zone,
447 - int trip, unsigned long *temp)
448 + int trip, int *temp)
449 {
450 struct int34x_thermal_zone *d = zone->devdata;
451 acpi_status status;
452 @@ -163,7 +163,7 @@ static struct thermal_zone_device_ops int340x_thermal_zone_ops = {
453 };
454
455 static int int340x_thermal_get_trip_config(acpi_handle handle, char *name,
456 - unsigned long *temp)
457 + int *temp)
458 {
459 unsigned long long r;
460 acpi_status status;
461 diff --git a/drivers/thermal/int340x_thermal/int340x_thermal_zone.h b/drivers/thermal/int340x_thermal/int340x_thermal_zone.h
462 index 9f38ab7..aaadf72 100644
463 --- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.h
464 +++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.h
465 @@ -21,7 +21,7 @@
466 #define INT340X_THERMAL_MAX_ACT_TRIP_COUNT 10
467
468 struct active_trip {
469 - unsigned long temp;
470 + int temp;
471 int id;
472 bool valid;
473 };
474 @@ -31,11 +31,11 @@ struct int34x_thermal_zone {
475 struct active_trip act_trips[INT340X_THERMAL_MAX_ACT_TRIP_COUNT];
476 unsigned long *aux_trips;
477 int aux_trip_nr;
478 - unsigned long psv_temp;
479 + int psv_temp;
480 int psv_trip_id;
481 - unsigned long crt_temp;
482 + int crt_temp;
483 int crt_trip_id;
484 - unsigned long hot_temp;
485 + int hot_temp;
486 int hot_trip_id;
487 struct thermal_zone_device *zone;
488 struct thermal_zone_device_ops *override_ops;
489 diff --git a/drivers/thermal/intel_soc_dts_thermal.c b/drivers/thermal/intel_soc_dts_thermal.c
490 index 9013505..fd550b9 100644
491 --- a/drivers/thermal/intel_soc_dts_thermal.c
492 +++ b/drivers/thermal/intel_soc_dts_thermal.c
493 @@ -106,7 +106,7 @@ err_ret:
494 }
495
496 static int sys_get_trip_temp(struct thermal_zone_device *tzd,
497 - int trip, unsigned long *temp)
498 + int trip, int *temp)
499 {
500 int status;
501 u32 out;
502 @@ -224,7 +224,7 @@ err_restore_ptps:
503 }
504
505 static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip,
506 - unsigned long temp)
507 + int temp)
508 {
509 struct soc_sensor_entry *aux_entry = tzd->devdata;
510 int status;
511 @@ -250,8 +250,7 @@ static int sys_get_trip_type(struct thermal_zone_device *thermal,
512 return 0;
513 }
514
515 -static int sys_get_curr_temp(struct thermal_zone_device *tzd,
516 - unsigned long *temp)
517 +static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
518 {
519 int status;
520 u32 out;
521 diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
522 index 668fb1b..03839df 100644
523 --- a/drivers/thermal/of-thermal.c
524 +++ b/drivers/thermal/of-thermal.c
525 @@ -87,7 +87,7 @@ struct __thermal_zone {
526 /*** DT thermal zone device callbacks ***/
527
528 static int of_thermal_get_temp(struct thermal_zone_device *tz,
529 - unsigned long *temp)
530 + int *temp)
531 {
532 struct __thermal_zone *data = tz->devdata;
533
534 @@ -173,7 +173,7 @@ EXPORT_SYMBOL_GPL(of_thermal_get_trip_points);
535 * Return: zero on success, error code otherwise
536 */
537 static int of_thermal_set_emul_temp(struct thermal_zone_device *tz,
538 - unsigned long temp)
539 + int temp)
540 {
541 struct __thermal_zone *data = tz->devdata;
542
543 @@ -306,7 +306,7 @@ static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip,
544 }
545
546 static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
547 - unsigned long *temp)
548 + int *temp)
549 {
550 struct __thermal_zone *data = tz->devdata;
551
552 @@ -319,7 +319,7 @@ static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
553 }
554
555 static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip,
556 - unsigned long temp)
557 + int temp)
558 {
559 struct __thermal_zone *data = tz->devdata;
560
561 @@ -333,7 +333,7 @@ static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip,
562 }
563
564 static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip,
565 - unsigned long *hyst)
566 + int *hyst)
567 {
568 struct __thermal_zone *data = tz->devdata;
569
570 @@ -346,7 +346,7 @@ static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip,
571 }
572
573 static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip,
574 - unsigned long hyst)
575 + int hyst)
576 {
577 struct __thermal_zone *data = tz->devdata;
578
579 @@ -360,7 +360,7 @@ static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip,
580 }
581
582 static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
583 - unsigned long *temp)
584 + int *temp)
585 {
586 struct __thermal_zone *data = tz->devdata;
587 int i;
588 diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
589 index fe4e767..5d4ae7d 100644
590 --- a/drivers/thermal/rcar_thermal.c
591 +++ b/drivers/thermal/rcar_thermal.c
592 @@ -200,8 +200,7 @@ err_out_unlock:
593 return ret;
594 }
595
596 -static int rcar_thermal_get_temp(struct thermal_zone_device *zone,
597 - unsigned long *temp)
598 +static int rcar_thermal_get_temp(struct thermal_zone_device *zone, int *temp)
599 {
600 struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone);
601
602 @@ -235,7 +234,7 @@ static int rcar_thermal_get_trip_type(struct thermal_zone_device *zone,
603 }
604
605 static int rcar_thermal_get_trip_temp(struct thermal_zone_device *zone,
606 - int trip, unsigned long *temp)
607 + int trip, int *temp)
608 {
609 struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone);
610 struct device *dev = rcar_priv_to_dev(priv);
611 @@ -299,7 +298,7 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable)
612 static void rcar_thermal_work(struct work_struct *work)
613 {
614 struct rcar_thermal_priv *priv;
615 - unsigned long cctemp, nctemp;
616 + int cctemp, nctemp;
617
618 priv = container_of(work, struct rcar_thermal_priv, work.work);
619
620 diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
621 index cd8f5f93..c89ffb2 100644
622 --- a/drivers/thermal/rockchip_thermal.c
623 +++ b/drivers/thermal/rockchip_thermal.c
624 @@ -64,7 +64,7 @@ struct rockchip_tsadc_chip {
625 void (*control)(void __iomem *reg, bool on);
626
627 /* Per-sensor methods */
628 - int (*get_temp)(int chn, void __iomem *reg, long *temp);
629 + int (*get_temp)(int chn, void __iomem *reg, int *temp);
630 void (*set_tshut_temp)(int chn, void __iomem *reg, long temp);
631 void (*set_tshut_mode)(int chn, void __iomem *reg, enum tshut_mode m);
632 };
633 @@ -191,7 +191,7 @@ static u32 rk_tsadcv2_temp_to_code(long temp)
634 return 0;
635 }
636
637 -static long rk_tsadcv2_code_to_temp(u32 code)
638 +static int rk_tsadcv2_code_to_temp(u32 code)
639 {
640 unsigned int low = 0;
641 unsigned int high = ARRAY_SIZE(v2_code_table) - 1;
642 @@ -277,7 +277,7 @@ static void rk_tsadcv2_control(void __iomem *regs, bool enable)
643 writel_relaxed(val, regs + TSADCV2_AUTO_CON);
644 }
645
646 -static int rk_tsadcv2_get_temp(int chn, void __iomem *regs, long *temp)
647 +static int rk_tsadcv2_get_temp(int chn, void __iomem *regs, int *temp)
648 {
649 u32 val;
650
651 @@ -366,7 +366,7 @@ static irqreturn_t rockchip_thermal_alarm_irq_thread(int irq, void *dev)
652 return IRQ_HANDLED;
653 }
654
655 -static int rockchip_thermal_get_temp(void *_sensor, long *out_temp)
656 +static int rockchip_thermal_get_temp(void *_sensor, int *out_temp)
657 {
658 struct rockchip_thermal_sensor *sensor = _sensor;
659 struct rockchip_thermal_data *thermal = sensor->thermal;
660 @@ -374,7 +374,7 @@ static int rockchip_thermal_get_temp(void *_sensor, long *out_temp)
661 int retval;
662
663 retval = tsadc->get_temp(sensor->id, thermal->regs, out_temp);
664 - dev_dbg(&thermal->pdev->dev, "sensor %d - temp: %ld, retval: %d\n",
665 + dev_dbg(&thermal->pdev->dev, "sensor %d - temp: %d, retval: %d\n",
666 sensor->id, *out_temp, retval);
667
668 return retval;
669 diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
670 index 1d30b09..29eaf4d 100644
671 --- a/drivers/thermal/samsung/exynos_tmu.c
672 +++ b/drivers/thermal/samsung/exynos_tmu.c
673 @@ -181,8 +181,7 @@ struct exynos_tmu_data {
674 int (*tmu_initialize)(struct platform_device *pdev);
675 void (*tmu_control)(struct platform_device *pdev, bool on);
676 int (*tmu_read)(struct exynos_tmu_data *data);
677 - void (*tmu_set_emulation)(struct exynos_tmu_data *data,
678 - unsigned long temp);
679 + void (*tmu_set_emulation)(struct exynos_tmu_data *data, int temp);
680 void (*tmu_clear_irqs)(struct exynos_tmu_data *data);
681 };
682
683 @@ -190,7 +189,7 @@ static void exynos_report_trigger(struct exynos_tmu_data *p)
684 {
685 char data[10], *envp[] = { data, NULL };
686 struct thermal_zone_device *tz = p->tzd;
687 - unsigned long temp;
688 + int temp;
689 unsigned int i;
690
691 if (!tz) {
692 @@ -489,7 +488,7 @@ static int exynos5440_tmu_initialize(struct platform_device *pdev)
693 struct exynos_tmu_data *data = platform_get_drvdata(pdev);
694 unsigned int trim_info = 0, con, rising_threshold;
695 int ret = 0, threshold_code;
696 - unsigned long crit_temp = 0;
697 + int crit_temp = 0;
698
699 /*
700 * For exynos5440 soc triminfo value is swapped between TMU0 and
701 @@ -542,7 +541,7 @@ static int exynos7_tmu_initialize(struct platform_device *pdev)
702 unsigned int status, trim_info;
703 unsigned int rising_threshold = 0, falling_threshold = 0;
704 int ret = 0, threshold_code, i;
705 - unsigned long temp, temp_hist;
706 + int temp, temp_hist;
707 unsigned int reg_off, bit_off;
708
709 status = readb(data->base + EXYNOS_TMU_REG_STATUS);
710 @@ -713,7 +712,7 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on)
711 writel(con, data->base + EXYNOS_TMU_REG_CONTROL);
712 }
713
714 -static int exynos_get_temp(void *p, long *temp)
715 +static int exynos_get_temp(void *p, int *temp)
716 {
717 struct exynos_tmu_data *data = p;
718
719 @@ -733,7 +732,7 @@ static int exynos_get_temp(void *p, long *temp)
720
721 #ifdef CONFIG_THERMAL_EMULATION
722 static u32 get_emul_con_reg(struct exynos_tmu_data *data, unsigned int val,
723 - unsigned long temp)
724 + int temp)
725 {
726 if (temp) {
727 temp /= MCELSIUS;
728 @@ -763,7 +762,7 @@ static u32 get_emul_con_reg(struct exynos_tmu_data *data, unsigned int val,
729 }
730
731 static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data,
732 - unsigned long temp)
733 + int temp)
734 {
735 unsigned int val;
736 u32 emul_con;
737 @@ -781,7 +780,7 @@ static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data,
738 }
739
740 static void exynos5440_tmu_set_emulation(struct exynos_tmu_data *data,
741 - unsigned long temp)
742 + int temp)
743 {
744 unsigned int val;
745
746 @@ -790,7 +789,7 @@ static void exynos5440_tmu_set_emulation(struct exynos_tmu_data *data,
747 writel(val, data->base + EXYNOS5440_TMU_S0_7_DEBUG);
748 }
749
750 -static int exynos_tmu_set_emulation(void *drv_data, unsigned long temp)
751 +static int exynos_tmu_set_emulation(void *drv_data, int temp)
752 {
753 struct exynos_tmu_data *data = drv_data;
754 int ret = -EINVAL;
755 diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
756 index bddb717..534dd91 100644
757 --- a/drivers/thermal/spear_thermal.c
758 +++ b/drivers/thermal/spear_thermal.c
759 @@ -38,7 +38,7 @@ struct spear_thermal_dev {
760 };
761
762 static inline int thermal_get_temp(struct thermal_zone_device *thermal,
763 - unsigned long *temp)
764 + int *temp)
765 {
766 struct spear_thermal_dev *stdev = thermal->devdata;
767
768 diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c
769 index 76c515d..44cbba9 100644
770 --- a/drivers/thermal/st/st_thermal.c
771 +++ b/drivers/thermal/st/st_thermal.c
772 @@ -111,8 +111,7 @@ static int st_thermal_calibration(struct st_thermal_sensor *sensor)
773 }
774
775 /* Callback to get temperature from HW*/
776 -static int st_thermal_get_temp(struct thermal_zone_device *th,
777 - unsigned long *temperature)
778 +static int st_thermal_get_temp(struct thermal_zone_device *th, int *temperature)
779 {
780 struct st_thermal_sensor *sensor = th->devdata;
781 struct device *dev = sensor->dev;
782 @@ -159,7 +158,7 @@ static int st_thermal_get_trip_type(struct thermal_zone_device *th,
783 }
784
785 static int st_thermal_get_trip_temp(struct thermal_zone_device *th,
786 - int trip, unsigned long *temp)
787 + int trip, int *temp)
788 {
789 struct st_thermal_sensor *sensor = th->devdata;
790 struct device *dev = sensor->dev;
791 diff --git a/drivers/thermal/step_wise.c b/drivers/thermal/step_wise.c
792 index 5a0f12d..2f9f708 100644
793 --- a/drivers/thermal/step_wise.c
794 +++ b/drivers/thermal/step_wise.c
795 @@ -113,7 +113,7 @@ static void update_passive_instance(struct thermal_zone_device *tz,
796
797 static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
798 {
799 - long trip_temp;
800 + int trip_temp;
801 enum thermal_trip_type trip_type;
802 enum thermal_trend trend;
803 struct thermal_instance *instance;
804 @@ -135,7 +135,7 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
805 trace_thermal_zone_trip(tz, trip, trip_type);
806 }
807
808 - dev_dbg(&tz->device, "Trip%d[type=%d,temp=%ld]:trend=%d,throttle=%d\n",
809 + dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n",
810 trip, trip_type, trip_temp, trend, throttle);
811
812 mutex_lock(&tz->lock);
813 diff --git a/drivers/thermal/tegra_soctherm.c b/drivers/thermal/tegra_soctherm.c
814 index 9197fc0..74ea576 100644
815 --- a/drivers/thermal/tegra_soctherm.c
816 +++ b/drivers/thermal/tegra_soctherm.c
817 @@ -293,7 +293,7 @@ static int enable_tsensor(struct tegra_soctherm *tegra,
818 * H denotes an addition of 0.5 Celsius and N denotes negation
819 * of the final value.
820 */
821 -static long translate_temp(u16 val)
822 +static int translate_temp(u16 val)
823 {
824 long t;
825
826 @@ -306,7 +306,7 @@ static long translate_temp(u16 val)
827 return t;
828 }
829
830 -static int tegra_thermctl_get_temp(void *data, long *out_temp)
831 +static int tegra_thermctl_get_temp(void *data, int *out_temp)
832 {
833 struct tegra_thermctl_zone *zone = data;
834 u32 val;
835 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
836 index 4108db7..62cc82a 100644
837 --- a/drivers/thermal/thermal_core.c
838 +++ b/drivers/thermal/thermal_core.c
839 @@ -363,7 +363,7 @@ static void handle_non_critical_trips(struct thermal_zone_device *tz,
840 static void handle_critical_trips(struct thermal_zone_device *tz,
841 int trip, enum thermal_trip_type trip_type)
842 {
843 - long trip_temp;
844 + int trip_temp;
845
846 tz->ops->get_trip_temp(tz, trip, &trip_temp);
847
848 @@ -411,12 +411,12 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
849 *
850 * Return: On success returns 0, an error code otherwise
851 */
852 -int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp)
853 +int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
854 {
855 int ret = -EINVAL;
856 #ifdef CONFIG_THERMAL_EMULATION
857 int count;
858 - unsigned long crit_temp = -1UL;
859 + int crit_temp = INT_MAX;
860 enum thermal_trip_type type;
861 #endif
862
863 @@ -453,8 +453,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_temp);
864
865 static void update_temperature(struct thermal_zone_device *tz)
866 {
867 - long temp;
868 - int ret;
869 + int temp, ret;
870
871 ret = thermal_zone_get_temp(tz, &temp);
872 if (ret) {
873 @@ -514,15 +513,14 @@ static ssize_t
874 temp_show(struct device *dev, struct device_attribute *attr, char *buf)
875 {
876 struct thermal_zone_device *tz = to_thermal_zone(dev);
877 - long temperature;
878 - int ret;
879 + int temperature, ret;
880
881 ret = thermal_zone_get_temp(tz, &temperature);
882
883 if (ret)
884 return ret;
885
886 - return sprintf(buf, "%ld\n", temperature);
887 + return sprintf(buf, "%d\n", temperature);
888 }
889
890 static ssize_t
891 @@ -626,7 +624,7 @@ trip_point_temp_show(struct device *dev, struct device_attribute *attr,
892 {
893 struct thermal_zone_device *tz = to_thermal_zone(dev);
894 int trip, ret;
895 - long temperature;
896 + int temperature;
897
898 if (!tz->ops->get_trip_temp)
899 return -EPERM;
900 @@ -639,7 +637,7 @@ trip_point_temp_show(struct device *dev, struct device_attribute *attr,
901 if (ret)
902 return ret;
903
904 - return sprintf(buf, "%ld\n", temperature);
905 + return sprintf(buf, "%d\n", temperature);
906 }
907
908 static ssize_t
909 @@ -648,7 +646,7 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
910 {
911 struct thermal_zone_device *tz = to_thermal_zone(dev);
912 int trip, ret;
913 - unsigned long temperature;
914 + int temperature;
915
916 if (!tz->ops->set_trip_hyst)
917 return -EPERM;
918 @@ -656,7 +654,7 @@ trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
919 if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip))
920 return -EINVAL;
921
922 - if (kstrtoul(buf, 10, &temperature))
923 + if (kstrtoint(buf, 10, &temperature))
924 return -EINVAL;
925
926 /*
927 @@ -675,7 +673,7 @@ trip_point_hyst_show(struct device *dev, struct device_attribute *attr,
928 {
929 struct thermal_zone_device *tz = to_thermal_zone(dev);
930 int trip, ret;
931 - unsigned long temperature;
932 + int temperature;
933
934 if (!tz->ops->get_trip_hyst)
935 return -EPERM;
936 @@ -685,7 +683,7 @@ trip_point_hyst_show(struct device *dev, struct device_attribute *attr,
937
938 ret = tz->ops->get_trip_hyst(tz, trip, &temperature);
939
940 - return ret ? ret : sprintf(buf, "%ld\n", temperature);
941 + return ret ? ret : sprintf(buf, "%d\n", temperature);
942 }
943
944 static ssize_t
945 diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
946 index 1967bee..06fd2ed9 100644
947 --- a/drivers/thermal/thermal_hwmon.c
948 +++ b/drivers/thermal/thermal_hwmon.c
949 @@ -69,7 +69,7 @@ static DEVICE_ATTR(name, 0444, name_show, NULL);
950 static ssize_t
951 temp_input_show(struct device *dev, struct device_attribute *attr, char *buf)
952 {
953 - long temperature;
954 + int temperature;
955 int ret;
956 struct thermal_hwmon_attr *hwmon_attr
957 = container_of(attr, struct thermal_hwmon_attr, attr);
958 @@ -83,7 +83,7 @@ temp_input_show(struct device *dev, struct device_attribute *attr, char *buf)
959 if (ret)
960 return ret;
961
962 - return sprintf(buf, "%ld\n", temperature);
963 + return sprintf(buf, "%d\n", temperature);
964 }
965
966 static ssize_t
967 @@ -95,14 +95,14 @@ temp_crit_show(struct device *dev, struct device_attribute *attr, char *buf)
968 = container_of(hwmon_attr, struct thermal_hwmon_temp,
969 temp_crit);
970 struct thermal_zone_device *tz = temp->tz;
971 - long temperature;
972 + int temperature;
973 int ret;
974
975 ret = tz->ops->get_trip_temp(tz, 0, &temperature);
976 if (ret)
977 return ret;
978
979 - return sprintf(buf, "%ld\n", temperature);
980 + return sprintf(buf, "%d\n", temperature);
981 }
982
983
984 @@ -142,7 +142,7 @@ thermal_hwmon_lookup_temp(const struct thermal_hwmon_device *hwmon,
985
986 static bool thermal_zone_crit_temp_valid(struct thermal_zone_device *tz)
987 {
988 - unsigned long temp;
989 + int temp;
990 return tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, &temp);
991 }
992
993 diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
994 index a38c175..d3a42bf 100644
995 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
996 +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
997 @@ -76,14 +76,14 @@ static inline int ti_thermal_hotspot_temperature(int t, int s, int c)
998
999 /* thermal zone ops */
1000 /* Get temperature callback function for thermal zone*/
1001 -static inline int __ti_thermal_get_temp(void *devdata, long *temp)
1002 +static inline int __ti_thermal_get_temp(void *devdata, int *temp)
1003 {
1004 struct thermal_zone_device *pcb_tz = NULL;
1005 struct ti_thermal_data *data = devdata;
1006 struct ti_bandgap *bgp;
1007 const struct ti_temp_sensor *s;
1008 int ret, tmp, slope, constant;
1009 - unsigned long pcb_temp;
1010 + int pcb_temp;
1011
1012 if (!data)
1013 return 0;
1014 @@ -119,7 +119,7 @@ static inline int __ti_thermal_get_temp(void *devdata, long *temp)
1015 }
1016
1017 static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal,
1018 - unsigned long *temp)
1019 + int *temp)
1020 {
1021 struct ti_thermal_data *data = thermal->devdata;
1022
1023 @@ -228,7 +228,7 @@ static int ti_thermal_get_trip_type(struct thermal_zone_device *thermal,
1024
1025 /* Get trip temperature callback functions for thermal zone */
1026 static int ti_thermal_get_trip_temp(struct thermal_zone_device *thermal,
1027 - int trip, unsigned long *temp)
1028 + int trip, int *temp)
1029 {
1030 if (!ti_thermal_is_valid_trip(trip))
1031 return -EINVAL;
1032 @@ -279,7 +279,7 @@ static int ti_thermal_get_trend(struct thermal_zone_device *thermal,
1033
1034 /* Get critical temperature callback functions for thermal zone */
1035 static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
1036 - unsigned long *temp)
1037 + int *temp)
1038 {
1039 /* shutdown zone */
1040 return ti_thermal_get_trip_temp(thermal, OMAP_TRIP_NUMBER - 1, temp);
1041 diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c
1042 index 9ea3d9d..054c6d45 100644
1043 --- a/drivers/thermal/x86_pkg_temp_thermal.c
1044 +++ b/drivers/thermal/x86_pkg_temp_thermal.c
1045 @@ -164,7 +164,7 @@ err_ret:
1046 return err;
1047 }
1048
1049 -static int sys_get_curr_temp(struct thermal_zone_device *tzd, unsigned long *temp)
1050 +static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
1051 {
1052 u32 eax, edx;
1053 struct phy_dev_entry *phy_dev_entry;
1054 @@ -175,7 +175,7 @@ static int sys_get_curr_temp(struct thermal_zone_device *tzd, unsigned long *tem
1055 if (eax & 0x80000000) {
1056 *temp = phy_dev_entry->tj_max -
1057 ((eax >> 16) & 0x7f) * 1000;
1058 - pr_debug("sys_get_curr_temp %ld\n", *temp);
1059 + pr_debug("sys_get_curr_temp %d\n", *temp);
1060 return 0;
1061 }
1062
1063 @@ -183,7 +183,7 @@ static int sys_get_curr_temp(struct thermal_zone_device *tzd, unsigned long *tem
1064 }
1065
1066 static int sys_get_trip_temp(struct thermal_zone_device *tzd,
1067 - int trip, unsigned long *temp)
1068 + int trip, int *temp)
1069 {
1070 u32 eax, edx;
1071 struct phy_dev_entry *phy_dev_entry;
1072 @@ -214,13 +214,13 @@ static int sys_get_trip_temp(struct thermal_zone_device *tzd,
1073 *temp = phy_dev_entry->tj_max - thres_reg_value * 1000;
1074 else
1075 *temp = 0;
1076 - pr_debug("sys_get_trip_temp %ld\n", *temp);
1077 + pr_debug("sys_get_trip_temp %d\n", *temp);
1078
1079 return 0;
1080 }
1081
1082 static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip,
1083 - unsigned long temp)
1084 + int temp)
1085 {
1086 u32 l, h;
1087 struct phy_dev_entry *phy_dev_entry;
1088 diff --git a/include/linux/thermal.h b/include/linux/thermal.h
1089 index 5eac316..e9f2863 100644
1090 --- a/include/linux/thermal.h
1091 +++ b/include/linux/thermal.h
1092 @@ -86,23 +86,19 @@ struct thermal_zone_device_ops {
1093 struct thermal_cooling_device *);
1094 int (*unbind) (struct thermal_zone_device *,
1095 struct thermal_cooling_device *);
1096 - int (*get_temp) (struct thermal_zone_device *, unsigned long *);
1097 + int (*get_temp) (struct thermal_zone_device *, int *);
1098 int (*get_mode) (struct thermal_zone_device *,
1099 enum thermal_device_mode *);
1100 int (*set_mode) (struct thermal_zone_device *,
1101 enum thermal_device_mode);
1102 int (*get_trip_type) (struct thermal_zone_device *, int,
1103 enum thermal_trip_type *);
1104 - int (*get_trip_temp) (struct thermal_zone_device *, int,
1105 - unsigned long *);
1106 - int (*set_trip_temp) (struct thermal_zone_device *, int,
1107 - unsigned long);
1108 - int (*get_trip_hyst) (struct thermal_zone_device *, int,
1109 - unsigned long *);
1110 - int (*set_trip_hyst) (struct thermal_zone_device *, int,
1111 - unsigned long);
1112 - int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *);
1113 - int (*set_emul_temp) (struct thermal_zone_device *, unsigned long);
1114 + int (*get_trip_temp) (struct thermal_zone_device *, int, int *);
1115 + int (*set_trip_temp) (struct thermal_zone_device *, int, int);
1116 + int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
1117 + int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
1118 + int (*get_crit_temp) (struct thermal_zone_device *, int *);
1119 + int (*set_emul_temp) (struct thermal_zone_device *, int);
1120 int (*get_trend) (struct thermal_zone_device *, int,
1121 enum thermal_trend *);
1122 int (*notify) (struct thermal_zone_device *, int,
1123 @@ -272,9 +268,9 @@ struct thermal_genl_event {
1124 * temperature.
1125 */
1126 struct thermal_zone_of_device_ops {
1127 - int (*get_temp)(void *, long *);
1128 + int (*get_temp)(void *, int *);
1129 int (*get_trend)(void *, long *);
1130 - int (*set_emul_temp)(void *, unsigned long);
1131 + int (*set_emul_temp)(void *, int);
1132 };
1133
1134 /**
1135 @@ -335,7 +331,7 @@ thermal_of_cooling_device_register(struct device_node *np, char *, void *,
1136 const struct thermal_cooling_device_ops *);
1137 void thermal_cooling_device_unregister(struct thermal_cooling_device *);
1138 struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
1139 -int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp);
1140 +int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
1141
1142 int get_tz_trend(struct thermal_zone_device *, int);
1143 struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
1144 @@ -378,7 +374,7 @@ static inline struct thermal_zone_device *thermal_zone_get_zone_by_name(
1145 const char *name)
1146 { return ERR_PTR(-ENODEV); }
1147 static inline int thermal_zone_get_temp(
1148 - struct thermal_zone_device *tz, unsigned long *temp)
1149 + struct thermal_zone_device *tz, int *temp)
1150 { return -ENODEV; }
1151 static inline int get_tz_trend(struct thermal_zone_device *tz, int trip)
1152 { return -ENODEV; }
1153 --
1154 1.7.10.4
1155