0010-thermal-consistently-use-int-for-temperatures.patch 34 KB

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