summaryrefslogtreecommitdiff
path: root/sys/dev/usb/udcf.c
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2006-10-11 13:06:36 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2006-10-11 13:06:36 +0000
commitf5e5b3eaf26d6ac0ed0be78ce86c813accf2a743 (patch)
tree15e0404ad23d856d2d2e740b616b366bdb41a3dd /sys/dev/usb/udcf.c
parentadde92128aaf9b5002fe7f66d57bc8c0260a95cd (diff)
Make the timedelta sensor appear right when a device is plugged-in, with a
status of SENSOR_S_UNKNOWN. Do not set the SENSOR_FINVALID bit, sysctl hw.sensors does not list sensors with this flags set and we want to the sensor when the device is present. ok henning
Diffstat (limited to 'sys/dev/usb/udcf.c')
-rw-r--r--sys/dev/usb/udcf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c
index 7a0f78045a5..9e9070fe9c2 100644
--- a/sys/dev/usb/udcf.c
+++ b/sys/dev/usb/udcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udcf.c,v 1.16 2006/06/23 06:27:11 miod Exp $ */
+/* $OpenBSD: udcf.c,v 1.17 2006/10/11 13:06:35 mbalmer Exp $ */
/*
* Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org>
@@ -178,7 +178,9 @@ USB_ATTACH(udcf)
sizeof(sc->sc_sensor.device));
sc->sc_sensor.type = SENSOR_TIMEDELTA;
sc->sc_sensor.status = SENSOR_S_UNKNOWN;
- sc->sc_sensor.flags = SENSOR_FINVALID;
+ sc->sc_sensor.value = 0LL;
+ sc->sc_sensor.flags = 0;
+ strlcpy(sc->sc_sensor.desc, "Unknown", sizeof(sc->sc_sensor.desc));
sensor_add(&sc->sc_sensor);
/* Prepare the USB request to probe the value */
@@ -402,7 +404,6 @@ udcf_probe(void *xsc)
clockname[CLOCK_HBG] :
clockname[CLOCK_DCF77],
sizeof(sc->sc_sensor.desc));
- sc->sc_sensor.flags &= ~SENSOR_FINVALID;
}
sc->sc_sensor.status = SENSOR_S_OK;