diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-02-08 19:02:38 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-02-08 19:02:38 +0000 |
commit | f7c05c75db4aeb20f3dc9f658bf97bd4677fd3c9 (patch) | |
tree | 7573705a13b22a50bca5e8b3e8ae9b351bd6712d /sys/dev/i2c | |
parent | b00b7f777d7ba91d56f519ad5fe7c6cd9bbcf3ac (diff) |
Fix lm75 check.
ok deraadt@
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r-- | sys/dev/i2c/i2c_scan.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c index 285860912f4..cc0414effaf 100644 --- a/sys/dev/i2c/i2c_scan.c +++ b/sys/dev/i2c/i2c_scan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i2c_scan.c,v 1.66 2006/02/04 18:19:20 kettenis Exp $ */ +/* $OpenBSD: i2c_scan.c,v 1.67 2006/02/08 19:02:37 kettenis Exp $ */ /* * Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org> @@ -159,15 +159,19 @@ lm75probe(void) u_int8_t conf; int ret = 75, i; - temp = iicprobew(LM75TEMP) & mask; + temp = iicprobew(LM75TEMP); conf = iicprobenc(LM75CONF); - thyst = iicprobew(LM75Thyst) & mask; - tos = iicprobew(LM75Tos) & mask; + thyst = iicprobew(LM75Thyst); + tos = iicprobew(LM75Tos); /* totally bogus data */ if (conf == 0xff && temp == 0xffff && thyst == 0xffff) return (NULL); + temp &= mask; + thyst &= mask; + tos &= mask; + /* All values the same? Very unlikely */ if (temp == thyst && thyst == tos) return (NULL); |