Commit 8b0f1840a46449e1946fc88860ef3ec8d6b1c2c7
Committed by
Jean Delvare
1 parent
52bc9802ce
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 1 additions and 3 deletions Side-by-side Diff
drivers/hwmon/adm1026.c
... | ... | @@ -920,9 +920,7 @@ |
920 | 920 | |
921 | 921 | val = simple_strtol(buf, NULL, 10); |
922 | 922 | new_div = DIV_TO_REG(val); |
923 | - if (new_div == 0) { | |
924 | - return -EINVAL; | |
925 | - } | |
923 | + | |
926 | 924 | mutex_lock(&data->update_lock); |
927 | 925 | orig_div = data->fan_div[nr]; |
928 | 926 | data->fan_div[nr] = DIV_FROM_REG(new_div); |