projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3faa1ff
)
hwmon/smsc47b397: Don't report missing fans as spinning at 82 RPM
author
Jean Delvare
<khali@linux-fr.org>
Sat, 23 Jun 2007 12:58:22 +0000
(14:58 +0200)
committer
Mark M. Hoffman
<mhoffman@lightlink.com>
Thu, 19 Jul 2007 18:22:16 +0000
(14:22 -0400)
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>
drivers/hwmon/smsc47b397.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/smsc47b397.c
b/drivers/hwmon/smsc47b397.c
index 3b65b0e61c49f51ed3709a5e67f5474a391065fb..45266b30ce1d760f800b79ea6f59dbd7a27d75b3 100644
(file)
--- 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);
REG: count of 90kHz pulses / revolution */
static int fan_from_reg(u16 reg)
{
+ if (reg == 0 || reg == 0xffff)
+ return 0;
return 90000 * 60 / reg;
}