thermal: consistently use int for trip temp

The commit 17e8351a7739 consistently use int for temperature,
however it missed a few in trip temperature and thermal_core.

In current codes, the trip->temperature used "unsigned long"
and zone->temperature used"int", if the temperature is negative
value, it will get wrong result when compare temperature with
trip temperature.

This patch can fix it.

Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

authored by Wei Ni and committed by Eduardo Valentin 1d0fd42f 62e14f6f

Changed files
+6 -6
drivers
thermal
include
linux
+4 -4
drivers/thermal/thermal_core.c
··· 688 688 { 689 689 struct thermal_zone_device *tz = to_thermal_zone(dev); 690 690 int trip, ret; 691 - unsigned long temperature; 691 + int temperature; 692 692 693 693 if (!tz->ops->set_trip_temp) 694 694 return -EPERM; ··· 696 696 if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip)) 697 697 return -EINVAL; 698 698 699 - if (kstrtoul(buf, 10, &temperature)) 699 + if (kstrtoint(buf, 10, &temperature)) 700 700 return -EINVAL; 701 701 702 702 ret = tz->ops->set_trip_temp(tz, trip, temperature); ··· 899 899 { 900 900 struct thermal_zone_device *tz = to_thermal_zone(dev); 901 901 int ret = 0; 902 - unsigned long temperature; 902 + int temperature; 903 903 904 - if (kstrtoul(buf, 10, &temperature)) 904 + if (kstrtoint(buf, 10, &temperature)) 905 905 return -EINVAL; 906 906 907 907 if (!tz->ops->set_emul_temp) {
+2 -2
include/linux/thermal.h
··· 352 352 353 353 struct thermal_trip { 354 354 struct device_node *np; 355 - unsigned long int temperature; 356 - unsigned long int hysteresis; 355 + int temperature; 356 + int hysteresis; 357 357 enum thermal_trip_type type; 358 358 }; 359 359