aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-06-23 08:58:22 -0400
committerMark M. Hoffman <mhoffman@lightlink.com>2007-07-19 14:22:16 -0400
commit90205c6cbb8fd9880bf798903a99f5b8903455e2 (patch)
tree16ee3e72a6c1f1d3dd13fe986aaa17128c108696 /drivers
parent3faa1ffb4f4be7d10715f4b003ff7b27d14eae26 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/smsc47b397.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c
index 3b65b0e61c49..45266b30ce1d 100644
--- a/drivers/hwmon/smsc47b397.c
+++ b/drivers/hwmon/smsc47b397.c
@@ -174,6 +174,8 @@ static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3);
174 REG: count of 90kHz pulses / revolution */ 174 REG: count of 90kHz pulses / revolution */
175static int fan_from_reg(u16 reg) 175static int fan_from_reg(u16 reg)
176{ 176{
177 if (reg == 0 || reg == 0xffff)
178 return 0;
177 return 90000 * 60 / reg; 179 return 90000 * 60 / reg;
178} 180}
179 181