summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-09-18 09:55:32 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-09-18 09:55:32 +0000
commit138d90b7843b167c256ae3bdd78bc8d218751f7a (patch)
tree0f56c8d53c28754daf58597230a88f02195567d9
parent53887f784a06721fbebc753884a6f5041a63334a (diff)
Set SENSOR_FINVALID instead of clearing it when reading fails.
ok otto@
-rw-r--r--sys/dev/i2c/thmc50.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/i2c/thmc50.c b/sys/dev/i2c/thmc50.c
index 2c9584110d4..ca310d68c4b 100644
--- a/sys/dev/i2c/thmc50.c
+++ b/sys/dev/i2c/thmc50.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: thmc50.c,v 1.1 2007/09/09 15:59:47 deraadt Exp $ */
+/* $OpenBSD: thmc50.c,v 1.2 2007/09/18 09:55:31 kettenis Exp $ */
/*
* Copyright (c) 2007 Theo de Raadt
@@ -127,7 +127,7 @@ thmc_refresh(void *arg)
sc->sc_sensor[THMC_TEMP0].value = 273150000 + 1000000 * sdata;
sc->sc_sensor[THMC_TEMP0].flags &= ~SENSOR_FINVALID;
} else
- sc->sc_sensor[THMC_TEMP0].flags &= ~SENSOR_FINVALID;
+ sc->sc_sensor[THMC_TEMP0].flags |= SENSOR_FINVALID;
cmd = THMC50_TEMP1;
if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,
@@ -135,7 +135,7 @@ thmc_refresh(void *arg)
sc->sc_sensor[THMC_TEMP1].value = 273150000 + 1000000 * sdata;
sc->sc_sensor[THMC_TEMP1].flags &= ~SENSOR_FINVALID;
} else
- sc->sc_sensor[THMC_TEMP1].flags &= ~SENSOR_FINVALID;
+ sc->sc_sensor[THMC_TEMP1].flags |= SENSOR_FINVALID;
if (sc->sc_sensor[THMC_TEMP2].type > 0) {
cmd = THMC50_TEMP2;
@@ -144,7 +144,7 @@ thmc_refresh(void *arg)
sc->sc_sensor[THMC_TEMP2].value = 273150000 + 1000000 * sdata;
sc->sc_sensor[THMC_TEMP2].flags &= ~SENSOR_FINVALID;
} else
- sc->sc_sensor[THMC_TEMP2].flags &= ~SENSOR_FINVALID;
+ sc->sc_sensor[THMC_TEMP2].flags |= SENSOR_FINVALID;
}
iic_release_bus(sc->sc_tag, 0);