summaryrefslogtreecommitdiff
path: root/sys/arch/loongson/dev/stsec.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-03-08 20:56:21 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-03-08 20:56:21 +0000
commit6ee20f08e58b111e479c75fe987a43d30040e370 (patch)
treea2e52be4640f941ee7b8360096e94af3ce18fa96 /sys/arch/loongson/dev/stsec.c
parent3ddf5c04d114a466a1a1020cc65ef9aa2dbfb3e9 (diff)
When sensor update fails, set SENSOR_FINVALID in sensor->flags;
from cnst, thanks! ok otto@
Diffstat (limited to 'sys/arch/loongson/dev/stsec.c')
-rw-r--r--sys/arch/loongson/dev/stsec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/loongson/dev/stsec.c b/sys/arch/loongson/dev/stsec.c
index f0bb3488f84..31a6387ff93 100644
--- a/sys/arch/loongson/dev/stsec.c
+++ b/sys/arch/loongson/dev/stsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stsec.c,v 1.3 2010/03/07 13:32:36 miod Exp $ */
+/* $OpenBSD: stsec.c,v 1.4 2010/03/08 20:56:20 miod Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
@@ -259,7 +259,7 @@ stsec_sensors_update(void *vsc)
#endif
for (i = 0; i < nitems(sc->sc_sensors); i++)
- sc->sc_sensors[i].status = SENSOR_S_UNKNOWN;
+ sc->sc_sensors[i].flags |= SENSOR_FINVALID;
if (stsec_read(sc, ST7_STATUS, &status) != 0 ||
stsec_read(sc, ST7_CONTROL, &control) != 0 ||
@@ -274,7 +274,7 @@ stsec_sensors_update(void *vsc)
ks = &sc->sc_sensors[STSEC_SENSOR_AC_PRESENCE];
ks->value = !!ISSET(status, STS_AC_AVAILABLE);
- ks->status = SENSOR_S_OK;
+ ks->flags &= ~SENSOR_FINVALID;
/*
* Old mobo design does not have a battery presence bit; the Linux
@@ -293,15 +293,15 @@ stsec_sensors_update(void *vsc)
ks->value = !!ISSET(status, STS_BATTERY_PRESENT);
break;
}
- ks->status = SENSOR_S_OK;
+ ks->flags &= ~SENSOR_FINVALID;
ks = &sc->sc_sensors[STSEC_SENSOR_BATTERY_STATE];
ks->value = !!ISSET(control, STC_CHARGE_ENABLE);
- ks->status = SENSOR_S_OK;
+ ks->flags &= ~SENSOR_FINVALID;
ks = &sc->sc_sensors[STSEC_SENSOR_BATTERY_VOLTAGE];
ks->value = (int64_t)batuv;
- ks->status = SENSOR_S_OK;
+ ks->flags &= ~SENSOR_FINVALID;
#if NAPM > 0
bcopy(&stsec_apmdata, &old, sizeof(old));