Skip to content

Commit

Permalink
hwmon: (adm1026) Allow 1 as a valid divider value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gabriele Gorla authored and Jean Delvare committed Dec 8, 2010
1 parent 52bc980 commit 8b0f184
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/hwmon/adm1026.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8b0f184

Please sign in to comment.