diff options
author | Gabriele Gorla <gorlik@penguintown.net> | 2010-12-08 16:27:22 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-07 14:43:05 -0800 |
commit | e2e722ca8f05cf468f497bfb5387acca64633d0a (patch) | |
tree | fb792679709aea944c2e6a6226245fbfc81231b7 | |
parent | 7df3fe5e2fcac3f469c4a6d4c4a4c0f4c4020983 (diff) |
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 <gorlik@penguintown.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/hwmon/adm1026.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index ff7de40b6e35..52312ab1514f 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c @@ -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); |