summaryrefslogtreecommitdiff
path: root/sys/dev/isa/aps.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-23 17:46:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-23 17:46:40 +0000
commit456453067d1414c6f4097d6aeaf996624183d72b (patch)
treeb3a5f4f9a05a1aba0dd603c6eb3a6ff0cd86ee9f /sys/dev/isa/aps.c
parent2da4a587cf08c4fd33f160fe0f40ff89d9d3a3c3 (diff)
adapt to new two-level sensor api; Constantine A. Murenin
Diffstat (limited to 'sys/dev/isa/aps.c')
-rw-r--r--sys/dev/isa/aps.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/isa/aps.c b/sys/dev/isa/aps.c
index 0fb04c3ed4b..aa9ccd05527 100644
--- a/sys/dev/isa/aps.c
+++ b/sys/dev/isa/aps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aps.c,v 1.8 2006/06/19 14:43:54 kettenis Exp $ */
+/* $OpenBSD: aps.c,v 1.9 2006/12/23 17:46:39 deraadt Exp $ */
/*
* Copyright (c) 2005 Jonathan Gray <jsg@openbsd.org>
*
@@ -157,12 +157,8 @@ aps_attach(struct device *parent, struct device *self, void *aux)
sizeof(sc->sensors[APS_SENSOR_YACCEL].desc), "Y_ACCEL");
sc->sensors[APS_SENSOR_TEMP1].type = SENSOR_TEMP;
- snprintf(sc->sensors[APS_SENSOR_TEMP1].desc,
- sizeof(sc->sensors[APS_SENSOR_TEMP1].desc), "Temp 1");
sc->sensors[APS_SENSOR_TEMP2].type = SENSOR_TEMP;
- snprintf(sc->sensors[APS_SENSOR_TEMP2].desc,
- sizeof(sc->sensors[APS_SENSOR_TEMP2].desc), "Temp 2");
sc->sensors[APS_SENSOR_XVAR].type = SENSOR_INTEGER;
snprintf(sc->sensors[APS_SENSOR_XVAR].desc,
@@ -189,11 +185,12 @@ aps_attach(struct device *parent, struct device *self, void *aux)
sizeof(sc->sensors[APS_SENSOR_LIDOPEN].desc), "Lid Open");
/* stop hiding and report to the authorities */
+ strlcpy(sc->sensordev.xname, sc->sc_dev.dv_xname,
+ sizeof(sc->sensordev.xname));
for (i = 0; i < sc->numsensors; i++) {
- strlcpy(sc->sensors[i].device, sc->sc_dev.dv_xname,
- sizeof(sc->sensors[i].device));
- sensor_add(&sc->sensors[i]);
+ sensor_attach(&sc->sensordev, &sc->sensors[i]);
}
+ sensordev_install(&sc->sensordev);
powerhook_establish(aps_power, (void *)sc);