projects/linux·commit 8b0f1840

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

8b0f1840 · Gabriele Gorla <[email protected]> · 2010-12-08 16:27:22 +01:00

Allow 1 as a valid div value as specified in the ADM1026 datasheet.

Signed-off-by: Gabriele Gorla <[email protected]>
Cc: [email protected]
Signed-off-by: Jean Delvare <[email protected]>
Commit
8b0f1840a46449e1946fc88860ef3ec8d6b1c2c7
Parents
52bc9802

Changes

1 files changed · +1 −3

FileStatusAddDelContent
drivers/hwmon/adm1026.cmodified+1−3View file

drivers/hwmon/adm1026.c

View file
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index 6f257ce..be0fdd5 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -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);