Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19bed646 authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

thermal: thermal-core: Change temp type from unsigned to int



Negative temperature values can be set by thermal clients
to the TSENS driver. Having unsgined long type prevents
clients using the set_trip_temp() thermal api to set
negative temperature values. On msm-3.4 kernel this api
had support to set negative temperature. Change the type
to support the negative temperature.

Change-Id: I987aed5a291b76d8360a9256cad0ff0c1adb06c8
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 9ccf1dee
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -874,7 +874,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
{
	struct thermal_zone_device *tz = to_thermal_zone(dev);
	int trip, ret;
	unsigned long temperature;
	long temperature;

	if (!tz->ops->set_trip_temp)
		return -EPERM;
@@ -882,7 +882,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
	if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip))
		return -EINVAL;

	if (kstrtoul(buf, 10, &temperature))
	if (kstrtol(buf, 10, &temperature))
		return -EINVAL;

	ret = sensor_set_trip_temp(tz, trip, temperature);