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

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>
This commit is contained in:
Gabriele Gorla 2010-12-08 16:27:22 +01:00 committed by Jean Delvare
parent 52bc9802ce
commit 8b0f1840a4
1 changed files with 1 additions and 3 deletions

View 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);