diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-12-23 17:46:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-12-23 17:46:40 +0000 |
commit | 456453067d1414c6f4097d6aeaf996624183d72b (patch) | |
tree | b3a5f4f9a05a1aba0dd603c6eb3a6ff0cd86ee9f /sys/arch/macppc/dev/asms.c | |
parent | 2da4a587cf08c4fd33f160fe0f40ff89d9d3a3c3 (diff) |
adapt to new two-level sensor api; Constantine A. Murenin
Diffstat (limited to 'sys/arch/macppc/dev/asms.c')
-rw-r--r-- | sys/arch/macppc/dev/asms.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/arch/macppc/dev/asms.c b/sys/arch/macppc/dev/asms.c index 17724436754..5c71f5219ec 100644 --- a/sys/arch/macppc/dev/asms.c +++ b/sys/arch/macppc/dev/asms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asms.c,v 1.3 2006/01/19 17:08:39 grange Exp $ */ +/* $OpenBSD: asms.c,v 1.4 2006/12/23 17:46:39 deraadt Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> * @@ -62,6 +62,7 @@ struct asms_softc { i2c_addr_t sc_addr; struct sensor sc_sensor[ASMS_NUM_SENSORS]; + struct sensordev sc_sensordev; }; int asms_match(struct device *, void *, void *); @@ -247,9 +248,8 @@ asms_attach(struct device *parent, struct device *self, void *aux) iic_release_bus(sc->sc_tag, 0); /* Initialize sensor data. */ - for (i = 0; i < ASMS_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[ASMS_DATA_X].type = SENSOR_INTEGER; strlcpy(sc->sc_sensor[ASMS_DATA_X].desc, "X_ACCEL", @@ -269,7 +269,8 @@ asms_attach(struct device *parent, struct device *self, void *aux) } for (i = 0; i < ASMS_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"); } |