summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2014-06-09 16:14:05 -0700
committerMandar Padmawar <mpadmawar@nvidia.com>2014-06-13 02:18:25 -0700
commit22f28a48d4270dcc6b932f1e6bd3cf78afa86833 (patch)
treed136b861462b7f90a578b79ec4f492cdd0cf4c5e /drivers/thermal
parentb4d6faa5e696db0724822c3f7ce37b72cda77c66 (diff)
thermal: remove all unsigned type use for temperature
Bug 1516918 Change-Id: I5615b0657d255d9134415d92d372771baa4271e1 Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-on: http://git-master/r/420818 GVS: Gerrit_Virtual_Submit Reviewed-by: Josh Kuo <joshk@nvidia.com> Reviewed-by: Jinyoung Park <jinyoungp@nvidia.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/generic_adc_thermal.c9
-rw-r--r--drivers/thermal/of-thermal.c16
-rw-r--r--drivers/thermal/palmas_thermal.c8
-rw-r--r--drivers/thermal/thermal_core.c12
4 files changed, 22 insertions, 23 deletions
diff --git a/drivers/thermal/generic_adc_thermal.c b/drivers/thermal/generic_adc_thermal.c
index 55dd95527dec..74e0cda662b8 100644
--- a/drivers/thermal/generic_adc_thermal.c
+++ b/drivers/thermal/generic_adc_thermal.c
@@ -149,8 +149,7 @@ static int gadc_thermal_unbind(struct thermal_zone_device *tz,
return 0;
}
-static int gadc_thermal_get_temp(struct thermal_zone_device *tz,
- unsigned long *temp)
+static int gadc_thermal_get_temp(struct thermal_zone_device *tz, long *temp)
{
struct gadc_thermal_driver_data *drvdata = tz->devdata;
int val = 0, val2 = 0;
@@ -185,7 +184,7 @@ static int gadc_thermal_get_trip_type(struct thermal_zone_device *tz, int trip,
}
static int gadc_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
- unsigned long *temp)
+ long *temp)
{
struct gadc_thermal_driver_data *drvdata = tz->devdata;
struct thermal_trip_info *trip_state = &drvdata->pdata->trips[trip];
@@ -207,7 +206,7 @@ static int gadc_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
}
static int gadc_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip,
- unsigned long temp)
+ long temp)
{
struct gadc_thermal_driver_data *drvdata = tz->devdata;
struct thermal_trip_info *trip_state = &drvdata->pdata->trips[trip];
@@ -335,7 +334,7 @@ static const struct file_operations raw_adc_fops = {
.release = single_release,
};
-static int temp_offset_write(struct file *file, const char __user *user_buf,
+static ssize_t temp_offset_write(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct gadc_thermal_driver_data *drvdata =
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 04b1be7fa018..2a84062e561f 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -45,8 +45,8 @@
struct __thermal_trip {
struct device_node *np;
- unsigned long int temperature;
- unsigned long int hysteresis;
+ long int temperature;
+ long int hysteresis;
enum thermal_trip_type type;
};
@@ -103,7 +103,7 @@ struct __thermal_zone {
/*** DT thermal zone device callbacks ***/
static int of_thermal_get_temp(struct thermal_zone_device *tz,
- unsigned long *temp)
+ long *temp)
{
struct __thermal_zone *data = tz->devdata;
@@ -236,7 +236,7 @@ static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip,
}
static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
- unsigned long *temp)
+ long *temp)
{
struct __thermal_zone *data = tz->devdata;
@@ -249,7 +249,7 @@ static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
}
static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip,
- unsigned long temp)
+ long temp)
{
struct __thermal_zone *data = tz->devdata;
@@ -263,7 +263,7 @@ static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip,
}
static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip,
- unsigned long *hyst)
+ long *hyst)
{
struct __thermal_zone *data = tz->devdata;
@@ -276,7 +276,7 @@ static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip,
}
static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip,
- unsigned long hyst)
+ long hyst)
{
struct __thermal_zone *data = tz->devdata;
@@ -290,7 +290,7 @@ static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip,
}
static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
- unsigned long *temp)
+ long *temp)
{
struct __thermal_zone *data = tz->devdata;
int i;
diff --git a/drivers/thermal/palmas_thermal.c b/drivers/thermal/palmas_thermal.c
index 84dbf5dd0e37..997916040839 100644
--- a/drivers/thermal/palmas_thermal.c
+++ b/drivers/thermal/palmas_thermal.c
@@ -40,7 +40,7 @@ struct palmas_therm_zone {
struct palmas *palmas;
struct thermal_zone_device *tz_device;
int irq;
- unsigned long hd_threshold_temp;
+ long hd_threshold_temp;
const char *tz_name;
};
@@ -53,7 +53,7 @@ static struct thermal_trip_info palmas_tpoint = {
};
static int palmas_thermal_get_temp(struct thermal_zone_device *tz_device,
- unsigned long *temp)
+ long *temp)
{
int ret;
unsigned int val;
@@ -87,7 +87,7 @@ static int palmas_thermal_get_trip_type(struct thermal_zone_device *tz_device,
}
static int palmas_thermal_get_trip_temp(struct thermal_zone_device *tz_device,
- int trip, unsigned long *temp)
+ int trip, long *temp)
{
if (trip >= 1)
return -EINVAL;
@@ -172,7 +172,7 @@ static int palmas_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ptherm_zone);
ptherm_zone->dev = &pdev->dev;
ptherm_zone->palmas = palmas;
- ptherm_zone->hd_threshold_temp = (unsigned long) hd_threshold_temp;
+ ptherm_zone->hd_threshold_temp = (long)hd_threshold_temp;
ptherm_zone->tz_name = tz_name;
ptherm_zone->tz_device = thermal_zone_device_register(tz_name,
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 72ac8a7770f6..b4d2c1eb616b 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -409,12 +409,12 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
*
* Return: On success returns 0, an error code otherwise
*/
-int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp)
+int thermal_zone_get_temp(struct thermal_zone_device *tz, long *temp)
{
int ret = -EINVAL;
#ifdef CONFIG_THERMAL_EMULATION
int count;
- unsigned long crit_temp = -1UL;
+ long crit_temp = INT_MAX;
enum thermal_trip_type type;
#endif
@@ -596,7 +596,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;
@@ -640,7 +640,7 @@ trip_point_hyst_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_hyst)
return -EPERM;
@@ -667,7 +667,7 @@ trip_point_hyst_show(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->get_trip_hyst)
return -EPERM;
@@ -864,7 +864,7 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
{
struct thermal_zone_device *tz = to_thermal_zone(dev);
int ret = 0;
- unsigned long temperature;
+ long temperature;
if (kstrtoul(buf, 10, &temperature))
return -EINVAL;