]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Jan 2011 22:43:05 +0000 (14:43 -0800)
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>
drivers/hwmon/adm1026.c

index ff7de40b6e35267c2836b03a98d4017e74e6414e..52312ab1514f37c0db88af95da0dbb901d225c16 100644 (file)
@@ -923,9 +923,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);