hwmon: (adm1026) Allow 1 as a valid divider value
authorGabriele Gorla <gorlik@penguintown.net>
Wed, 8 Dec 2010 15:27:22 +0000 (16:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Feb 2011 21:15:36 +0000 (22:15 +0100)
commit 8b0f1840a46449e1946fc88860ef3ec8d6b1c2c7 upstream.

Allow 1 as a valid div value as specified in the ADM1026 datasheet.

Signed-off-by: Gabriele Gorla <gorlik@penguintown.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/hwmon/adm1026.c

index 7fe2441fc8455f93fc175ddeaa12531f5777cb2b..08eab8549c2ee777aa91eae4ba11649f2745e848 100644 (file)
@@ -926,9 +926,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);