aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83627ehf.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/w83627ehf.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/w83627ehf.c')
-rw-r--r--drivers/hwmon/w83627ehf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index d9a9ec7dd84a..e3dfc52b5995 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -223,7 +223,7 @@ temp1_from_reg(s8 reg)
223} 223}
224 224
225static inline s8 225static inline s8
226temp1_to_reg(int temp, int min, int max) 226temp1_to_reg(long temp, int min, int max)
227{ 227{
228 if (temp <= min) 228 if (temp <= min)
229 return min / 1000; 229 return min / 1000;
@@ -805,7 +805,7 @@ store_temp1_##reg(struct device *dev, struct device_attribute *attr, \
805 const char *buf, size_t count) \ 805 const char *buf, size_t count) \
806{ \ 806{ \
807 struct w83627ehf_data *data = dev_get_drvdata(dev); \ 807 struct w83627ehf_data *data = dev_get_drvdata(dev); \
808 u32 val = simple_strtoul(buf, NULL, 10); \ 808 long val = simple_strtol(buf, NULL, 10); \
809 \ 809 \
810 mutex_lock(&data->update_lock); \ 810 mutex_lock(&data->update_lock); \
811 data->temp1_##reg = temp1_to_reg(val, -128000, 127000); \ 811 data->temp1_##reg = temp1_to_reg(val, -128000, 127000); \
@@ -840,7 +840,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
840 struct w83627ehf_data *data = dev_get_drvdata(dev); \ 840 struct w83627ehf_data *data = dev_get_drvdata(dev); \
841 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \ 841 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \
842 int nr = sensor_attr->index; \ 842 int nr = sensor_attr->index; \
843 u32 val = simple_strtoul(buf, NULL, 10); \ 843 long val = simple_strtol(buf, NULL, 10); \
844 \ 844 \
845 mutex_lock(&data->update_lock); \ 845 mutex_lock(&data->update_lock); \
846 data->reg[nr] = LM75_TEMP_TO_REG(val); \ 846 data->reg[nr] = LM75_TEMP_TO_REG(val); \