aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/asb100.c
diff options
context:
space:
mode:
authorChristian Hohnstaedt <chohnstaedt@innominate.com>2007-08-16 05:40:10 -0400
committerMark M. Hoffman <mhoffman@lightlink.com>2007-10-09 22:56:29 -0400
commit5bfedac045082a97e20d47d876071279ef984d28 (patch)
treec6432db00589d4858ca1b4a04624dc74be5ba181 /drivers/hwmon/asb100.c
parentdcf3b5fb7fb6e1b56bfaf705e665b04870213768 (diff)
hwmon: Allow writing of negative trigger temperatures
- replace differing temperature variable types by long - use strtol() instead of strtoul() for conversion Signed-off-by: Christian Hohnstaedt <chohnstaedt@innominate.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon/asb100.c')
-rw-r--r--drivers/hwmon/asb100.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index 57b1c7b7ac3f..55d92e1e27d1 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -143,7 +143,7 @@ static int FAN_FROM_REG(u8 val, int div)
143 143
144/* TEMP: 0.001C/bit (-128C to +127C) 144/* TEMP: 0.001C/bit (-128C to +127C)
145 REG: 1C/bit, two's complement */ 145 REG: 1C/bit, two's complement */
146static u8 TEMP_TO_REG(int temp) 146static u8 TEMP_TO_REG(long temp)
147{ 147{
148 int ntemp = SENSORS_LIMIT(temp, ASB100_TEMP_MIN, ASB100_TEMP_MAX); 148 int ntemp = SENSORS_LIMIT(temp, ASB100_TEMP_MIN, ASB100_TEMP_MAX);
149 ntemp += (ntemp<0 ? -500 : 500); 149 ntemp += (ntemp<0 ? -500 : 500);
@@ -448,7 +448,7 @@ static ssize_t set_##reg(struct device *dev, const char *buf, \
448{ \ 448{ \
449 struct i2c_client *client = to_i2c_client(dev); \ 449 struct i2c_client *client = to_i2c_client(dev); \
450 struct asb100_data *data = i2c_get_clientdata(client); \ 450 struct asb100_data *data = i2c_get_clientdata(client); \
451 unsigned long val = simple_strtoul(buf, NULL, 10); \ 451 long val = simple_strtol(buf, NULL, 10); \
452 \ 452 \
453 mutex_lock(&data->update_lock); \ 453 mutex_lock(&data->update_lock); \
454 switch (nr) { \ 454 switch (nr) { \