summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2006-02-08 19:02:37 +0000
committerkettenis <kettenis@openbsd.org>2006-02-08 19:02:37 +0000
commit82814087d12357228ffd2b95db9b1396f79590df (patch)
treef2a7055395c8cc101d53c0f3b901ed4fcbda1cf8
parentonce again, we have to unbreak stuff xsa broke on his own. (diff)
downloadwireguard-openbsd-82814087d12357228ffd2b95db9b1396f79590df.tar.xz
wireguard-openbsd-82814087d12357228ffd2b95db9b1396f79590df.zip
Fix lm75 check.
ok deraadt@
-rw-r--r--sys/dev/i2c/i2c_scan.c12
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);