summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2005-11-11 16:14:15 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2005-11-11 16:14:15 +0000
commit3b64408ee0613637240a5c91711675f7940a506e (patch)
treea815d1ab8df995490c7191eeed3756b811b0d881 /sys/dev
parent366c6d81662efb8e3db5a48d9dd01b32e8e1972d (diff)
Use sensors thread instead of timeouts.
ok dlg@, "slap it in" deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/i2c/lm75.c10
-rw-r--r--sys/dev/i2c/lm75reg.h4
2 files changed, 4 insertions, 10 deletions
diff --git a/sys/dev/i2c/lm75.c b/sys/dev/i2c/lm75.c
index 162247bdc60..c16e8932dc6 100644
--- a/sys/dev/i2c/lm75.c
+++ b/sys/dev/i2c/lm75.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm75.c,v 1.1 2004/05/23 18:12:37 grange Exp $ */
+/* $OpenBSD: lm75.c,v 1.2 2005/11/11 16:14:14 kettenis Exp $ */
/* $NetBSD: lm75.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
@@ -60,7 +60,6 @@
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/sensors.h>
-#include <sys/timeout.h>
#include <dev/i2c/i2cvar.h>
#include <dev/i2c/lm75reg.h>
@@ -72,7 +71,6 @@ struct lmtemp_softc {
int sc_model;
struct sensor sc_sensor;
- struct timeout sc_timeout;
};
int lmtemp_match(struct device *, void *, void *);
@@ -149,9 +147,7 @@ lmtemp_attach(struct device *parent, struct device *self, void *aux)
/* Hook into the hw.sensors sysctl */
SENSOR_ADD(&sc->sc_sensor);
- /* Set poll timer */
- timeout_set(&sc->sc_timeout, lmtemp_refresh_sensor_data, sc);
- timeout_add(&sc->sc_timeout, LM_POLLTIME);
+ sensor_task_register(sc, lmtemp_refresh_sensor_data, LM_POLLTIME);
}
int
@@ -215,6 +211,4 @@ lmtemp_refresh_sensor_data(void *aux)
sc->sc_sensor.value = val * 500000 + 273150000;
sc->sc_sensor.flags &= ~SENSOR_FINVALID;
-
- timeout_add(&sc->sc_timeout, LM_POLLTIME);
}
diff --git a/sys/dev/i2c/lm75reg.h b/sys/dev/i2c/lm75reg.h
index 892b8b56791..3eee0f079d7 100644
--- a/sys/dev/i2c/lm75reg.h
+++ b/sys/dev/i2c/lm75reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm75reg.h,v 1.1 2004/05/23 18:12:37 grange Exp $ */
+/* $OpenBSD: lm75reg.h,v 1.2 2005/11/11 16:14:14 kettenis Exp $ */
/* $NetBSD: lm75reg.h,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
@@ -57,7 +57,7 @@
#define LM_MODEL_LM75 1
#define LM_MODEL_LM77 2
-#define LM_POLLTIME (hz * 2) /* 2s */
+#define LM_POLLTIME 2 /* 2s */
/*
* LM75 temperature sensor I2C address: