diff options
Diffstat (limited to 'sys/dev/i2c/tsl2560.c')
-rw-r--r-- | sys/dev/i2c/tsl2560.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/i2c/tsl2560.c b/sys/dev/i2c/tsl2560.c index 28ea49cd4a9..e5dd30ba1a6 100644 --- a/sys/dev/i2c/tsl2560.c +++ b/sys/dev/i2c/tsl2560.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tsl2560.c,v 1.3 2006/01/19 17:08:39 grange Exp $ */ +/* $OpenBSD: tsl2560.c,v 1.4 2006/12/23 17:46:39 deraadt Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -41,6 +41,7 @@ struct tsl_softc { i2c_addr_t sc_addr; struct sensor sc_sensor; + struct sensordev sc_sensordev; }; int tsl_match(struct device *, void *, void *); @@ -115,17 +116,17 @@ tsl_attach(struct device *parent, struct device *self, void *aux) } /* Initialize sensor data. */ - strlcpy(sc->sc_sensor.device, sc->sc_dev.dv_xname, - sizeof(sc->sc_sensor.device)); + strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname, + sizeof(sc->sc_sensordev.xname)); sc->sc_sensor.type = SENSOR_LUX; - strlcpy(sc->sc_sensor.desc, "LUX", sizeof(sc->sc_sensor.desc)); if (sensor_task_register(sc, tsl_refresh, 5)) { printf(": unable to register update task\n"); return; } - sensor_add(&sc->sc_sensor); + sensor_attach(&sc->sc_sensordev, &sc->sc_sensor); + sensordev_install(&sc->sc_sensordev); printf("\n"); } |