Commit e2e722ca authored by Gabriele Gorla's avatar Gabriele Gorla Committed by Greg Kroah-Hartman

hwmon: (adm1026) Allow 1 as a valid divider value

commit 8b0f1840 upstream.

Allow 1 as a valid div value as specified in the ADM1026 datasheet.
Signed-off-by: default avatarGabriele Gorla <gorlik@penguintown.net>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7df3fe5e
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment