aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adm1026.c
diff options
context:
space:
mode:
authorGabriele Gorla <gorlik@penguintown.net>2010-12-08 10:27:22 -0500
committerJean Delvare <khali@endymion.delvare>2010-12-08 10:27:22 -0500
commit8b0f1840a46449e1946fc88860ef3ec8d6b1c2c7 (patch)
treed313520d2c32bfe3a603cbaca59ca84cc34e0a04 /drivers/hwmon/adm1026.c
parent52bc9802ce849d0d287cc5fe76d06b0daa3986ca (diff)
hwmon: (adm1026) Allow 1 as a valid divider value
Allow 1 as a valid div value as specified in the ADM1026 datasheet. Signed-off-by: Gabriele Gorla <gorlik@penguintown.net> Cc: stable@kernel.org Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/adm1026.c')
-rw-r--r--drivers/hwmon/adm1026.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index 6f257ce1ae07..be0fdd58aa29 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -920,9 +920,7 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
920 920
921 val = simple_strtol(buf, NULL, 10); 921 val = simple_strtol(buf, NULL, 10);
922 new_div = DIV_TO_REG(val); 922 new_div = DIV_TO_REG(val);
923 if (new_div == 0) { 923
924 return -EINVAL;
925 }
926 mutex_lock(&data->update_lock); 924 mutex_lock(&data->update_lock);
927 orig_div = data->fan_div[nr]; 925 orig_div = data->fan_div[nr];
928 data->fan_div[nr] = DIV_FROM_REG(new_div); 926 data->fan_div[nr] = DIV_FROM_REG(new_div);