Skip to content

Commit

Permalink
hwmon/smsc47b397: Don't report missing fans as spinning at 82 RPM
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Delvare authored and Mark M. Hoffman committed Jul 19, 2007
1 parent 3faa1ff commit 90205c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hwmon/smsc47b397.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 90205c6

Please sign in to comment.