Commit 90205c6c authored by Jean Delvare's avatar Jean Delvare Committed by Mark M. Hoffman

hwmon/smsc47b397: Don't report missing fans as spinning at 82 RPM

Also protects ourselves against a possible division by zero.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarMark M. Hoffman <mhoffman@lightlink.com>
parent 3faa1ffb
...@@ -174,6 +174,8 @@ static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3); ...@@ -174,6 +174,8 @@ static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3);
REG: count of 90kHz pulses / revolution */ REG: count of 90kHz pulses / revolution */
static int fan_from_reg(u16 reg) static int fan_from_reg(u16 reg)
{ {
if (reg == 0 || reg == 0xffff)
return 0;
return 90000 * 60 / reg; return 90000 * 60 / reg;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment