From: Gabriele Gorla Date: Wed, 8 Dec 2010 15:27:22 +0000 (+0100) Subject: hwmon: (adm1026) Allow 1 as a valid divider value X-Git-Tag: v2.6.34.9~44 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=65b35399d24e70a59f3200749c5190584d586731;p=karo-tx-linux.git hwmon: (adm1026) Allow 1 as a valid divider value commit 8b0f1840a46449e1946fc88860ef3ec8d6b1c2c7 upstream. Allow 1 as a valid div value as specified in the ADM1026 datasheet. Signed-off-by: Gabriele Gorla Signed-off-by: Jean Delvare Signed-off-by: Paul Gortmaker --- diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index 65335b268fa9..e059a5f8025d 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, val = simple_strtol(buf, NULL, 10); new_div = DIV_TO_REG(val); - if (new_div == 0) { - return -EINVAL; - } + mutex_lock(&data->update_lock); orig_div = data->fan_div[nr]; data->fan_div[nr] = DIV_FROM_REG(new_div);