summaryrefslogtreecommitdiff
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
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>
-rw-r--r--arch/arm/mach-tegra/tegra11_soctherm.c12
-rw-r--r--drivers/misc/nct1008.c24
-rw-r--r--drivers/misc/therm_est.c7
-rw-r--r--drivers/misc/therm_fan_est.c15
-rw-r--r--drivers/power/power_supply_core.c3
-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
-rw-r--r--include/linux/thermal.h22
10 files changed, 53 insertions, 75 deletions
diff --git a/arch/arm/mach-tegra/tegra11_soctherm.c b/arch/arm/mach-tegra/tegra11_soctherm.c
index 9e217bf5a04e..b6112b343d7f 100644
--- a/arch/arm/mach-tegra/tegra11_soctherm.c
+++ b/arch/arm/mach-tegra/tegra11_soctherm.c
@@ -1512,8 +1512,7 @@ static int soctherm_unbind(struct thermal_zone_device *thz,
*
* Return: 0
*/
-static int soctherm_get_temp(struct thermal_zone_device *thz,
- unsigned long *temp)
+static int soctherm_get_temp(struct thermal_zone_device *thz, long *temp)
{
struct soctherm_therm *therm = thz->devdata;
ptrdiff_t index = therm - plat_data.therm;
@@ -1612,11 +1611,11 @@ static int soctherm_get_trip_type(struct thermal_zone_device *thz,
*/
static int soctherm_get_trip_temp(struct thermal_zone_device *thz,
- int trip, unsigned long *temp)
+ int trip, long *temp)
{
struct soctherm_therm *therm = thz->devdata;
struct thermal_trip_info *trip_state;
- unsigned long trip_temp, zone_temp;
+ long trip_temp, zone_temp;
trip_state = &therm->trips[trip];
trip_temp = trip_state->trip_temp;
@@ -1649,7 +1648,7 @@ static int soctherm_get_trip_temp(struct thermal_zone_device *thz,
* Return: 0 if successful else %-EINVAL
*/
static int soctherm_set_trip_temp(struct thermal_zone_device *thz,
- int trip, unsigned long temp)
+ int trip, long temp)
{
struct soctherm_therm *therm = thz->devdata;
struct thermal_trip_info *trip_state;
@@ -1696,8 +1695,7 @@ static int soctherm_set_trip_temp(struct thermal_zone_device *thz,
* Return: 0 if it is able to find a critical temperature point and stores it
* into the variable pointed by the address in @temp; Otherwise, return -EINVAL.
*/
-static int soctherm_get_crit_temp(struct thermal_zone_device *thz,
- unsigned long *temp)
+static int soctherm_get_crit_temp(struct thermal_zone_device *thz, long *temp)
{
int i;
struct soctherm_therm *therm = thz->devdata;
diff --git a/drivers/misc/nct1008.c b/drivers/misc/nct1008.c
index f2a04ad866fa..115a1c6ab84b 100644
--- a/drivers/misc/nct1008.c
+++ b/drivers/misc/nct1008.c
@@ -794,8 +794,7 @@ static void nct1008_update(int sensor, struct nct1008_data *data)
nct1008_thermal_set_limits(sensor, data, low_temp, high_temp);
}
-static int nct1008_ext_get_temp(struct thermal_zone_device *thz,
- unsigned long *temp)
+static int nct1008_ext_get_temp(struct thermal_zone_device *thz, long *temp)
{
struct nct1008_data *data = thz->devdata;
@@ -864,8 +863,7 @@ static inline int nct1008_loc_unbind(struct thermal_zone_device *thz,
/* This function reads the temperature value set for the given trip point. */
static int nct1008_get_trip_temp(int sensor,
struct thermal_zone_device *thz,
- int trip,
- unsigned long *temp)
+ int trip, long *temp)
{
struct nct1008_data *data = thz->devdata;
struct thermal_trip_info *trip_state =
@@ -890,8 +888,7 @@ static int nct1008_get_trip_temp(int sensor,
/* This function reads the temperature value set for the given trip point for
the local sensor. */
static inline int nct1008_loc_get_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long *temp)
+ int trip, long *temp)
{
return nct1008_get_trip_temp(LOC, thz, trip, temp);
}
@@ -899,8 +896,7 @@ static inline int nct1008_loc_get_trip_temp(struct thermal_zone_device *thz,
/* This function reads the temperature value set for the given trip point for
the remote sensor. */
static inline int nct1008_ext_get_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long *temp)
+ int trip, long *temp)
{
return nct1008_get_trip_temp(EXT, thz, trip, temp);
}
@@ -909,8 +905,7 @@ static inline int nct1008_ext_get_trip_temp(struct thermal_zone_device *thz,
specified. */
static int nct1008_set_trip_temp(int sensor,
struct thermal_zone_device *thz,
- int trip,
- unsigned long temp)
+ int trip, long temp)
{
struct nct1008_data *data = thz->devdata;
@@ -921,8 +916,7 @@ static int nct1008_set_trip_temp(int sensor,
/* This function allows setting trip point temperature for the local sensor. */
static inline int nct1008_loc_set_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long temp)
+ int trip, long temp)
{
return nct1008_set_trip_temp(LOC, thz, trip, temp);
}
@@ -930,8 +924,7 @@ static inline int nct1008_loc_set_trip_temp(struct thermal_zone_device *thz,
/* This function allows setting trip point temperature for the external
* sensor. */
static inline int nct1008_ext_set_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long temp)
+ int trip, long temp)
{
return nct1008_set_trip_temp(EXT, thz, trip, temp);
}
@@ -1012,8 +1005,7 @@ static inline int nct1008_ext_get_trend(struct thermal_zone_device *thz,
}
/* Helper function to get temperature of the local sensor. */
-static int nct1008_loc_get_temp(struct thermal_zone_device *thz,
- unsigned long *temp)
+static int nct1008_loc_get_temp(struct thermal_zone_device *thz, long *temp)
{
struct nct1008_data *data = thz->devdata;
diff --git a/drivers/misc/therm_est.c b/drivers/misc/therm_est.c
index 48f5786e6563..abc6fc3a2ce6 100644
--- a/drivers/misc/therm_est.c
+++ b/drivers/misc/therm_est.c
@@ -371,7 +371,7 @@ static int __get_trip_temp(struct thermal_zone_device *thz, int trip,
}
static int therm_est_get_trip_temp(struct thermal_zone_device *thz,
- int trip, unsigned long *temp)
+ int trip, long *temp)
{
struct therm_estimator *est = thz->devdata;
struct therm_est_timer_trip_info *timer_info;
@@ -401,7 +401,7 @@ static int therm_est_get_trip_temp(struct thermal_zone_device *thz,
}
static int therm_est_set_trip_temp(struct thermal_zone_device *thz,
- int trip, unsigned long temp)
+ int trip, long temp)
{
struct therm_estimator *est = thz->devdata;
@@ -412,8 +412,7 @@ static int therm_est_set_trip_temp(struct thermal_zone_device *thz,
return 0;
}
-static int therm_est_get_temp(struct thermal_zone_device *thz,
- unsigned long *temp)
+static int therm_est_get_temp(struct thermal_zone_device *thz, long *temp)
{
struct therm_estimator *est = thz->devdata;
diff --git a/drivers/misc/therm_fan_est.c b/drivers/misc/therm_fan_est.c
index ad1a59672d4d..9312a01741eb 100644
--- a/drivers/misc/therm_fan_est.c
+++ b/drivers/misc/therm_fan_est.c
@@ -59,8 +59,6 @@ static void fan_set_trip_temp_hyst(struct therm_fan_estimator *est, int trip,
unsigned long hyst_temp,
unsigned long trip_temp)
{
- int i;
-
est->active_hysteresis[trip] = hyst_temp;
est->active_trip_temps[trip] = trip_temp;
est->active_trip_temps_hyst[(trip << 1)] = trip_temp;
@@ -153,8 +151,7 @@ static int therm_fan_est_get_trip_type(struct thermal_zone_device *thz,
}
static int therm_fan_est_get_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long *temp)
+ int trip, long *temp)
{
struct therm_fan_estimator *est = thz->devdata;
@@ -170,8 +167,7 @@ static int therm_fan_est_get_trip_temp(struct thermal_zone_device *thz,
}
static int therm_fan_est_set_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long temp)
+ int trip, long temp)
{
struct therm_fan_estimator *est = thz->devdata;
@@ -183,8 +179,7 @@ static int therm_fan_est_set_trip_temp(struct thermal_zone_device *thz,
return 0;
}
-static int therm_fan_est_get_temp(struct thermal_zone_device *thz,
- unsigned long *temp)
+static int therm_fan_est_get_temp(struct thermal_zone_device *thz, long *temp)
{
struct therm_fan_estimator *est = thz->devdata;
@@ -193,7 +188,7 @@ static int therm_fan_est_get_temp(struct thermal_zone_device *thz,
}
static int therm_fan_est_set_trip_hyst(struct thermal_zone_device *thz,
- int trip, unsigned long hyst_temp)
+ int trip, long hyst_temp)
{
struct therm_fan_estimator *est = thz->devdata;
@@ -207,7 +202,7 @@ static int therm_fan_est_set_trip_hyst(struct thermal_zone_device *thz,
}
static int therm_fan_est_get_trip_hyst(struct thermal_zone_device *thz,
- int trip, unsigned long *temp)
+ int trip, long *temp)
{
struct therm_fan_estimator *est = thz->devdata;
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 082d3c2714e9..a79e30455c99 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -342,8 +342,7 @@ static void power_supply_dev_release(struct device *dev)
}
#ifdef CONFIG_THERMAL
-static int power_supply_read_temp(struct thermal_zone_device *tzd,
- unsigned long *temp)
+static int power_supply_read_temp(struct thermal_zone_device *tzd, long *temp)
{
struct power_supply *psy;
union power_supply_propval val;
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;
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 4b203c9055a7..338dcfa3a8bc 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -113,23 +113,19 @@ struct thermal_zone_device_ops {
struct thermal_cooling_device *);
int (*unbind) (struct thermal_zone_device *,
struct thermal_cooling_device *);
- int (*get_temp) (struct thermal_zone_device *, unsigned long *);
+ int (*get_temp) (struct thermal_zone_device *, long *);
int (*get_mode) (struct thermal_zone_device *,
enum thermal_device_mode *);
int (*set_mode) (struct thermal_zone_device *,
enum thermal_device_mode);
int (*get_trip_type) (struct thermal_zone_device *, int,
enum thermal_trip_type *);
- int (*get_trip_temp) (struct thermal_zone_device *, int,
- unsigned long *);
- int (*set_trip_temp) (struct thermal_zone_device *, int,
- unsigned long);
- int (*get_trip_hyst) (struct thermal_zone_device *, int,
- unsigned long *);
- int (*set_trip_hyst) (struct thermal_zone_device *, int,
- unsigned long);
- int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *);
- int (*set_emul_temp) (struct thermal_zone_device *, unsigned long);
+ int (*get_trip_temp) (struct thermal_zone_device *, int, long *);
+ int (*set_trip_temp) (struct thermal_zone_device *, int, long);
+ int (*get_trip_hyst) (struct thermal_zone_device *, int, long *);
+ int (*set_trip_hyst) (struct thermal_zone_device *, int, long);
+ int (*get_crit_temp) (struct thermal_zone_device *, long *);
+ int (*set_emul_temp) (struct thermal_zone_device *, long);
int (*get_trend) (struct thermal_zone_device *, int,
enum thermal_trend *);
int (*notify) (struct thermal_zone_device *, int,
@@ -175,7 +171,7 @@ struct thermal_zone_device {
int last_temperature;
int emul_temperature;
int passive;
- unsigned int forced_passive;
+ int forced_passive;
struct thermal_zone_device_ops *ops;
const struct thermal_zone_params *tzp;
struct thermal_governor *governor;
@@ -301,7 +297,7 @@ thermal_of_cooling_device_register(struct device_node *np, char *, void *,
const struct thermal_cooling_device_ops *);
void thermal_cooling_device_unregister(struct thermal_cooling_device *);
struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
-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);
struct thermal_zone_device *thermal_zone_device_find(void *data,
int (*match)(struct thermal_zone_device *, void *));
struct thermal_zone_device *thermal_zone_device_find_by_name(const char *name);