Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b0f1840 authored by Gabriele Gorla's avatar Gabriele Gorla Committed by Jean Delvare
Browse files

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: default avatarGabriele Gorla <gorlik@penguintown.net>
Cc: stable@kernel.org
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 52bc9802
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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);