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

Also protects ourselves against a possible division by zero.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
This commit is contained in:
Jean Delvare 2007-06-23 14:58:22 +02:00 committed by Mark M. Hoffman
parent 3faa1ffb4f
commit 90205c6cbb
1 changed files with 2 additions and 0 deletions

View File

@ -174,6 +174,8 @@ static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3);
REG: count of 90kHz pulses / revolution */
static int fan_from_reg(u16 reg)
{
if (reg == 0 || reg == 0xffff)
return 0;
return 90000 * 60 / reg;
}