]> git.openfabrics.org - ~shefty/rdma-dev.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)
committerJean Delvare <khali@endymion.delvare>
Wed, 8 Dec 2010 15:27:22 +0000 (16:27 +0100)
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>
drivers/hwmon/adm1026.c

index 6f257ce1ae079f89147ee655121ad9c30efb8200..be0fdd58aa29301fbe15f9186580d724ba769544 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);