summaryrefslogtreecommitdiff
path: root/sys/dev/i2c/adm1021.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/i2c/adm1021.c
parent2da4a587cf08c4fd33f160fe0f40ff89d9d3a3c3 (diff)
adapt to new two-level sensor api; Constantine A. Murenin
Diffstat (limited to 'sys/dev/i2c/adm1021.c')
-rw-r--r--sys/dev/i2c/adm1021.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/i2c/adm1021.c b/sys/dev/i2c/adm1021.c
index bc1540c20c0..d2658649877 100644
--- a/sys/dev/i2c/adm1021.c
+++ b/sys/dev/i2c/adm1021.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1021.c,v 1.24 2006/07/20 21:23:42 kettenis Exp $ */
+/* $OpenBSD: adm1021.c,v 1.25 2006/12/23 17:46:39 deraadt Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -46,6 +46,7 @@ struct admtemp_softc {
i2c_addr_t sc_addr;
struct sensor sc_sensor[ADMTEMP_NUM_SENSORS];
+ struct sensordev sc_sensordev;
int sc_noexternal;
};
@@ -137,18 +138,17 @@ admtemp_attach(struct device *parent, struct device *self, void *aux)
iic_release_bus(sc->sc_tag, 0);
/* Initialize sensor data. */
- for (i = 0; i < ADMTEMP_NUM_SENSORS; i++)
- strlcpy(sc->sc_sensor[i].device, sc->sc_dev.dv_xname,
- sizeof(sc->sc_sensor[i].device));
+ strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname,
+ sizeof(sc->sc_sensordev.xname));
sc->sc_sensor[ADMTEMP_EXT].type = SENSOR_TEMP;
strlcpy(sc->sc_sensor[ADMTEMP_EXT].desc,
- xeon ? "Xeon Temp" : "External Temp",
+ xeon ? "Xeon" : "External",
sizeof(sc->sc_sensor[ADMTEMP_EXT].desc));
sc->sc_sensor[ADMTEMP_INT].type = SENSOR_TEMP;
strlcpy(sc->sc_sensor[ADMTEMP_INT].desc,
- xeon ? "Xeon Temp" : "Internal Temp",
+ xeon ? "Xeon" : "Internal",
sizeof(sc->sc_sensor[ADMTEMP_INT].desc));
if (sensor_task_register(sc, admtemp_refresh, 5)) {
@@ -157,7 +157,8 @@ admtemp_attach(struct device *parent, struct device *self, void *aux)
}
for (i = 0; i < (sc->sc_noexternal ? 1 : ADMTEMP_NUM_SENSORS); i++)
- sensor_add(&sc->sc_sensor[i]);
+ sensor_attach(&sc->sc_sensordev, &sc->sc_sensor[i]);
+ sensordev_install(&sc->sc_sensordev);
printf("\n");
}