]> git.karo-electronics.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)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 17 Apr 2011 20:16:08 +0000 (16:16 -0400)
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: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/hwmon/adm1026.c

index 65335b268fa99860e50a0ad84d794c9640ea7913..e059a5f8025df24ee00d4c13af9b9cb316f586df 100644 (file)
@@ -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);