summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-06-24 05:34:36 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-06-24 05:34:36 +0000
commit8919a22510bb2d5e5a6af011d229ac38e966a1a0 (patch)
treec5ffaca5117bee9e089dc3fc5c042d12f0e24d58 /sys/dev
parent741fb47166c6a7ffa0aea3684329acedb201ef7c (diff)
rework sensor tasks to use the kernels generic workq rather than a special
kernel thread of its own. the api has changed (which will be fixed in the manpage shortly) so all the users of sensor tasks that i can find have been fixed too. noone tested, so its going in to force people to run with it. "put it in" deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/i2c/ad741x.c4
-rw-r--r--sys/dev/i2c/adm1021.c4
-rw-r--r--sys/dev/i2c/adm1024.c4
-rw-r--r--sys/dev/i2c/adm1025.c4
-rw-r--r--sys/dev/i2c/adm1026.c4
-rw-r--r--sys/dev/i2c/adm1030.c4
-rw-r--r--sys/dev/i2c/adm1031.c4
-rw-r--r--sys/dev/i2c/adt7460.c4
-rw-r--r--sys/dev/i2c/asb100.c4
-rw-r--r--sys/dev/i2c/ds1631.c4
-rw-r--r--sys/dev/i2c/fcu.c4
-rw-r--r--sys/dev/i2c/fintek.c4
-rw-r--r--sys/dev/i2c/gl518sm.c4
-rw-r--r--sys/dev/i2c/lm87.c4
-rw-r--r--sys/dev/i2c/maxim6690.c4
-rw-r--r--sys/dev/i2c/pca9554.c4
-rw-r--r--sys/dev/i2c/tsl2560.c4
-rw-r--r--sys/dev/i2c/w83l784r.c4
-rw-r--r--sys/dev/ic/ami.c4
-rw-r--r--sys/dev/ic/ciss.c4
-rw-r--r--sys/dev/ic/lm78.c8
-rw-r--r--sys/dev/ic/lm78var.h3
-rw-r--r--sys/dev/ic/mfi.c4
-rw-r--r--sys/dev/isa/it.c4
-rw-r--r--sys/dev/onewire/owsbm.c10
-rw-r--r--sys/dev/onewire/owtemp.c9
-rw-r--r--sys/dev/pci/arc.c4
-rw-r--r--sys/dev/softraid.c4
28 files changed, 68 insertions, 58 deletions
diff --git a/sys/dev/i2c/ad741x.c b/sys/dev/i2c/ad741x.c
index 0c82851cfa8..75810de22ac 100644
--- a/sys/dev/i2c/ad741x.c
+++ b/sys/dev/i2c/ad741x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ad741x.c,v 1.11 2007/04/09 19:31:22 kettenis Exp $ */
+/* $OpenBSD: ad741x.c,v 1.12 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -139,7 +139,7 @@ adc_attach(struct device *parent, struct device *self, void *aux)
nsens += 3;
}
- if (sensor_task_register(sc, adc_refresh, 5)) {
+ if (sensor_task_register(sc, adc_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/adm1021.c b/sys/dev/i2c/adm1021.c
index b8f44afe0d9..e49e67b1215 100644
--- a/sys/dev/i2c/adm1021.c
+++ b/sys/dev/i2c/adm1021.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1021.c,v 1.26 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -151,7 +151,7 @@ admtemp_attach(struct device *parent, struct device *self, void *aux)
xeon ? "Xeon" : "Internal",
sizeof(sc->sc_sensor[ADMTEMP_INT].desc));
- if (sensor_task_register(sc, admtemp_refresh, 5)) {
+ if (sensor_task_register(sc, admtemp_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/adm1024.c b/sys/dev/i2c/adm1024.c
index 630cc3cdec6..e826660e4b5 100644
--- a/sys/dev/i2c/adm1024.c
+++ b/sys/dev/i2c/adm1024.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1024.c,v 1.13 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: adm1024.c,v 1.14 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -171,7 +171,7 @@ admlc_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sensor[ADMLC_FAN2].type = SENSOR_FANRPM;
- if (sensor_task_register(sc, admlc_refresh, 5)) {
+ if (sensor_task_register(sc, admlc_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/adm1025.c b/sys/dev/i2c/adm1025.c
index 911c8398203..5a92ab081b7 100644
--- a/sys/dev/i2c/adm1025.c
+++ b/sys/dev/i2c/adm1025.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1025.c,v 1.24 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: adm1025.c,v 1.25 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -179,7 +179,7 @@ admtm_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_sensor[SMSC_TEMP2].desc, "External",
sizeof(sc->sc_sensor[SMSC_TEMP2].desc));
- if (sensor_task_register(sc, admtm_refresh, 5)) {
+ if (sensor_task_register(sc, admtm_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/adm1026.c b/sys/dev/i2c/adm1026.c
index 26cea62b63e..4b5deeb0534 100644
--- a/sys/dev/i2c/adm1026.c
+++ b/sys/dev/i2c/adm1026.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1026.c,v 1.9 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: adm1026.c,v 1.10 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -213,7 +213,7 @@ admcts_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sensor[ADMCTS_FAN6].type = SENSOR_FANRPM;
sc->sc_sensor[ADMCTS_FAN7].type = SENSOR_FANRPM;
- if (sensor_task_register(sc, admcts_refresh, 5)) {
+ if (sensor_task_register(sc, admcts_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/adm1030.c b/sys/dev/i2c/adm1030.c
index 3e8f9ee7aca..cbabb569097 100644
--- a/sys/dev/i2c/adm1030.c
+++ b/sys/dev/i2c/adm1030.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1030.c,v 1.7 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: adm1030.c,v 1.8 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -102,7 +102,7 @@ admtmp_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sensor[ADMTMP_FAN].type = SENSOR_FANRPM;
- if (sensor_task_register(sc, admtmp_refresh, 5)) {
+ if (sensor_task_register(sc, admtmp_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/adm1031.c b/sys/dev/i2c/adm1031.c
index cdbc443e71d..0bf9dd54af3 100644
--- a/sys/dev/i2c/adm1031.c
+++ b/sys/dev/i2c/adm1031.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adm1031.c,v 1.7 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: adm1031.c,v 1.8 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -112,7 +112,7 @@ admtt_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sensor[ADMTT_FAN2].type = SENSOR_FANRPM;
- if (sensor_task_register(sc, admtt_refresh, 5)) {
+ if (sensor_task_register(sc, admtt_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/adt7460.c b/sys/dev/i2c/adt7460.c
index 52d2ce85247..afaeac888a8 100644
--- a/sys/dev/i2c/adt7460.c
+++ b/sys/dev/i2c/adt7460.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adt7460.c,v 1.17 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: adt7460.c,v 1.18 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -231,7 +231,7 @@ adt_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sensor[ADT_TACH3].type = SENSOR_FANRPM;
sc->sc_sensor[ADT_TACH4].type = SENSOR_FANRPM;
- if (sensor_task_register(sc, adt_refresh, 5)) {
+ if (sensor_task_register(sc, adt_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/asb100.c b/sys/dev/i2c/asb100.c
index 43759eab6dc..37961c82ece 100644
--- a/sys/dev/i2c/asb100.c
+++ b/sys/dev/i2c/asb100.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asb100.c,v 1.9 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: asb100.c,v 1.10 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Damien Miller <djm@openbsd.org>
@@ -258,7 +258,7 @@ asbtm_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_sensor[ASB100_SENSOR_TEMP3].desc, "External",
sizeof(sc->sc_sensor[ASB100_SENSOR_TEMP3].desc));
- if (sensor_task_register(sc, asbtm_refresh, 5)) {
+ if (sensor_task_register(sc, asbtm_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/ds1631.c b/sys/dev/i2c/ds1631.c
index 0eeb55f8b8b..c0a911dcff3 100644
--- a/sys/dev/i2c/ds1631.c
+++ b/sys/dev/i2c/ds1631.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ds1631.c,v 1.8 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: ds1631.c,v 1.9 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -120,7 +120,7 @@ dostart:
strlcpy(sc->sc_sensor[MAXDS_TEMP].desc, "Internal",
sizeof(sc->sc_sensor[MAXDS_TEMP].desc));
- if (sensor_task_register(sc, maxds_refresh, 5)) {
+ if (sensor_task_register(sc, maxds_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/fcu.c b/sys/dev/i2c/fcu.c
index ea2ec733291..3d93aa5649f 100644
--- a/sys/dev/i2c/fcu.c
+++ b/sys/dev/i2c/fcu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fcu.c,v 1.6 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: fcu.c,v 1.7 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -98,7 +98,7 @@ fcu_attach(struct device *parent, struct device *self, void *aux)
sizeof(sc->sc_sensor[FCU_PWM1 + i].desc));
}
- if (sensor_task_register(sc, fcu_refresh, 5)) {
+ if (sensor_task_register(sc, fcu_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/fintek.c b/sys/dev/i2c/fintek.c
index 7ad803d5ebb..2fb24d0fe4c 100644
--- a/sys/dev/i2c/fintek.c
+++ b/sys/dev/i2c/fintek.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fintek.c,v 1.5 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: fintek.c,v 1.6 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2006 Dale Rahn <drahn@openbsd.org>
*
@@ -155,7 +155,7 @@ fintek_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sensor[F_FAN1].type = SENSOR_FANRPM;
sc->sc_sensor[F_FAN2].type = SENSOR_FANRPM;
- if (sensor_task_register(sc, fintek_refresh, 5)) {
+ if (sensor_task_register(sc, fintek_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/gl518sm.c b/sys/dev/i2c/gl518sm.c
index d92cccab043..d1c00429014 100644
--- a/sys/dev/i2c/gl518sm.c
+++ b/sys/dev/i2c/gl518sm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gl518sm.c,v 1.5 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: gl518sm.c,v 1.6 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis
@@ -155,7 +155,7 @@ glenv_attach(struct device *parent, struct device *self, void *aux)
if (sc->sc_fan2_div == -1)
sc->sc_sensor[GLENV_FAN2].flags |= SENSOR_FINVALID;
- if (sensor_task_register(sc, glenv_refresh, 5)) {
+ if (sensor_task_register(sc, glenv_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/lm87.c b/sys/dev/i2c/lm87.c
index 038b7d50961..1ecf04d2c7a 100644
--- a/sys/dev/i2c/lm87.c
+++ b/sys/dev/i2c/lm87.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm87.c,v 1.18 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: lm87.c,v 1.19 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -223,7 +223,7 @@ lmenv_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sensor[LMENV_FAN2].type = SENSOR_FANRPM;
}
- if (sensor_task_register(sc, lmenv_refresh, 5)) {
+ if (sensor_task_register(sc, lmenv_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/maxim6690.c b/sys/dev/i2c/maxim6690.c
index f8448595d13..085aaff18cc 100644
--- a/sys/dev/i2c/maxim6690.c
+++ b/sys/dev/i2c/maxim6690.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: maxim6690.c,v 1.14 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: maxim6690.c,v 1.15 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -132,7 +132,7 @@ maxtmp_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_sensor[MAXTMP_EXT].desc, "External",
sizeof(sc->sc_sensor[MAXTMP_EXT].desc));
- if (sensor_task_register(sc, maxtmp_refresh, 5)) {
+ if (sensor_task_register(sc, maxtmp_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/pca9554.c b/sys/dev/i2c/pca9554.c
index dae1db08d55..473c3563f65 100644
--- a/sys/dev/i2c/pca9554.c
+++ b/sys/dev/i2c/pca9554.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pca9554.c,v 1.10 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: pca9554.c,v 1.11 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Theo de Raadt
@@ -129,7 +129,7 @@ pcagpio_attach(struct device *parent, struct device *self, void *aux)
}
- if (sensor_task_register(sc, pcagpio_refresh, 5)) {
+ if (sensor_task_register(sc, pcagpio_refresh, 5) == NULL) {
printf(", unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/tsl2560.c b/sys/dev/i2c/tsl2560.c
index 967981acfd9..d5a5665c5b5 100644
--- a/sys/dev/i2c/tsl2560.c
+++ b/sys/dev/i2c/tsl2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsl2560.c,v 1.5 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: tsl2560.c,v 1.6 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -120,7 +120,7 @@ tsl_attach(struct device *parent, struct device *self, void *aux)
sizeof(sc->sc_sensordev.xname));
sc->sc_sensor.type = SENSOR_LUX;
- if (sensor_task_register(sc, tsl_refresh, 5)) {
+ if (sensor_task_register(sc, tsl_refresh, 5) == NULL) {
printf(": unable to register update task\n");
return;
}
diff --git a/sys/dev/i2c/w83l784r.c b/sys/dev/i2c/w83l784r.c
index 9795bab4aef..0b33f8a432e 100644
--- a/sys/dev/i2c/w83l784r.c
+++ b/sys/dev/i2c/w83l784r.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: w83l784r.c,v 1.11 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: w83l784r.c,v 1.12 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis
@@ -219,7 +219,7 @@ wbenv_attach(struct device *parent, struct device *self, void *aux)
iic_ignore_addr(sc->sc_addr[2]);
start:
- if (sensor_task_register(sc, wbenv_refresh, 5)) {
+ if (sensor_task_register(sc, wbenv_refresh, 5) == NULL) {
printf("%s: unable to register update task\n",
sc->sc_dev.dv_xname);
return;
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c
index a4f558d30a0..d1a46b97a5d 100644
--- a/sys/dev/ic/ami.c
+++ b/sys/dev/ic/ami.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ami.c,v 1.183 2007/05/31 18:39:03 dlg Exp $ */
+/* $OpenBSD: ami.c,v 1.184 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -2474,7 +2474,7 @@ ami_create_sensors(struct ami_softc *sc)
if (sc->sc_bd == NULL)
goto bad;
- if (sensor_task_register(sc, ami_refresh_sensors, 10) != 0)
+ if (sensor_task_register(sc, ami_refresh_sensors, 10) == NULL)
goto freebd;
sensordev_install(&sc->sc_sensordev);
diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c
index bb229a41e76..260872fc2ba 100644
--- a/sys/dev/ic/ciss.c
+++ b/sys/dev/ic/ciss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciss.c,v 1.26 2007/05/29 22:17:50 todd Exp $ */
+/* $OpenBSD: ciss.c,v 1.27 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
@@ -438,7 +438,7 @@ ciss_attach(struct ciss_softc *sc)
scsibus->sc_link[i][0]->device_softc)->dv_xname,
sizeof(sc->sc_lds[i]->xname));
}
- if (sensor_task_register(sc, ciss_sensors, 10))
+ if (sensor_task_register(sc, ciss_sensors, 10) == NULL)
free(sc->sensors, M_DEVBUF);
else
sensordev_install(&sc->sensordev);
diff --git a/sys/dev/ic/lm78.c b/sys/dev/ic/lm78.c
index b55567be46e..7323beecb52 100644
--- a/sys/dev/ic/lm78.c
+++ b/sys/dev/ic/lm78.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm78.c,v 1.18 2007/05/26 22:47:39 cnst Exp $ */
+/* $OpenBSD: lm78.c,v 1.19 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
@@ -399,7 +399,8 @@ lm_attach(struct lm_softc *sc)
if (sc->numsensors == 0)
return;
- if (sensor_task_register(sc, lm_refresh, 5)) {
+ sc->sensortask = sensor_task_register(sc, lm_refresh, 5);
+ if (sc->sensortask == NULL) {
printf("%s: unable to register update task\n",
sc->sc_dev.dv_xname);
return;
@@ -425,7 +426,8 @@ lm_detach(struct lm_softc *sc)
for (i = 0; i < sc->numsensors; i++)
sensor_detach(&sc->sensordev, &sc->sensors[i]);
- sensor_task_unregister(sc);
+ if (sc->sensortask != NULL)
+ sensor_task_unregister(sc->sensortask);
return 0;
}
diff --git a/sys/dev/ic/lm78var.h b/sys/dev/ic/lm78var.h
index 6ea9697e843..7ab9437bd16 100644
--- a/sys/dev/ic/lm78var.h
+++ b/sys/dev/ic/lm78var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lm78var.h,v 1.12 2007/05/25 02:26:43 cnst Exp $ */
+/* $OpenBSD: lm78var.h,v 1.13 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 Mark Kettenis
@@ -140,6 +140,7 @@ struct lm_softc {
struct ksensor sensors[WB_MAX_SENSORS];
struct ksensordev sensordev;
+ struct sensor_task *sensortask;
struct lm_sensor *lm_sensors;
u_int numsensors;
void (*refresh_sensor_data) (struct lm_softc *);
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index 0ed0ee857b9..05c404bdca1 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.72 2007/05/29 22:17:50 todd Exp $ */
+/* $OpenBSD: mfi.c,v 1.73 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -1817,7 +1817,7 @@ mfi_create_sensors(struct mfi_softc *sc)
sensor_attach(&sc->sc_sensordev, &sc->sc_sensors[i]);
}
- if (sensor_task_register(sc, mfi_refresh_sensors, 10) != 0)
+ if (sensor_task_register(sc, mfi_refresh_sensors, 10) == NULL)
goto bad;
sensordev_install(&sc->sc_sensordev);
diff --git a/sys/dev/isa/it.c b/sys/dev/isa/it.c
index 63583a3ddbf..79c51ac1baa 100644
--- a/sys/dev/isa/it.c
+++ b/sys/dev/isa/it.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: it.c,v 1.22 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: it.c,v 1.23 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2003 Julien Bordet <zejames@greyhats.org>
@@ -155,7 +155,7 @@ it_attach(struct device *parent, struct device *self, void *aux)
it_setup_volt(sc, 3, 9);
it_setup_temp(sc, 12, 3);
- if (sensor_task_register(sc, it_refresh, 5)) {
+ if (sensor_task_register(sc, it_refresh, 5) == NULL) {
printf("%s: unable to register update task\n",
sc->sc_dev.dv_xname);
return;
diff --git a/sys/dev/onewire/owsbm.c b/sys/dev/onewire/owsbm.c
index 8bbb7e5c5be..3f6ef634f2a 100644
--- a/sys/dev/onewire/owsbm.c
+++ b/sys/dev/onewire/owsbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owsbm.c,v 1.3 2007/06/01 23:35:00 cnst Exp $ */
+/* $OpenBSD: owsbm.c,v 1.4 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2007 Aaron Linville <aaron@linville.org>
@@ -69,6 +69,8 @@ struct owsbm_softc {
struct ksensor sc_voltage_vad; /* General purpose, AD = 0 */
struct ksensor sc_voltage_cr; /* Current Register */
+ struct sensor_task *sc_sensortask;
+
struct rwlock sc_lock;
};
@@ -132,7 +134,8 @@ owsbm_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_voltage_cr.desc, "CR", sizeof(sc->sc_voltage_cr.desc));
sensor_attach(&sc->sc_sensordev, &sc->sc_voltage_cr);
- if (sensor_task_register(sc, owsbm_update, 10)) {
+ sc->sc_sensortask = sensor_task_register(sc, owsbm_update, 10);
+ if (sc->sc_sensortask == NULL) {
printf(": unable to register owsbm update task\n");
return;
}
@@ -150,7 +153,8 @@ owsbm_detach(struct device *self, int flags)
rw_enter_write(&sc->sc_lock);
sensordev_deinstall(&sc->sc_sensordev);
- sensor_task_unregister(sc);
+ if (sc->sc_sensortask != NULL)
+ sensor_task_unregister(sc->sc_sensortask);
rw_exit_write(&sc->sc_lock);
return (0);
diff --git a/sys/dev/onewire/owtemp.c b/sys/dev/onewire/owtemp.c
index 47f78c67612..29250ff918f 100644
--- a/sys/dev/onewire/owtemp.c
+++ b/sys/dev/onewire/owtemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owtemp.c,v 1.7 2007/03/22 16:55:31 deraadt Exp $ */
+/* $OpenBSD: owtemp.c,v 1.8 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -53,6 +53,7 @@ struct owtemp_softc {
struct ksensor sc_sensor;
struct ksensordev sc_sensordev;
+ struct sensor_task *sc_sensortask;
struct rwlock sc_lock;
};
@@ -100,7 +101,8 @@ owtemp_attach(struct device *parent, struct device *self, void *aux)
sizeof(sc->sc_sensordev.xname));
sc->sc_sensor.type = SENSOR_TEMP;
- if (sensor_task_register(sc, owtemp_update, 5)) {
+ sc->sc_sensortask = sensor_task_register(sc, owtemp_update, 5);
+ if (sc->sc_sensortask == NULL) {
printf(": unable to register update task\n");
return;
}
@@ -118,7 +120,8 @@ owtemp_detach(struct device *self, int flags)
rw_enter_write(&sc->sc_lock);
sensordev_deinstall(&sc->sc_sensordev);
- sensor_task_unregister(sc);
+ if (sc->sc_sensortask != NULL)
+ sensor_task_unregister(sc->sc_sensortask);
rw_exit_write(&sc->sc_lock);
return (0);
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c
index a651bc44365..bb349144315 100644
--- a/sys/dev/pci/arc.c
+++ b/sys/dev/pci/arc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc.c,v 1.63 2007/05/29 22:17:50 todd Exp $ */
+/* $OpenBSD: arc.c,v 1.64 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -1564,7 +1564,7 @@ arc_create_sensors(void *xsc, void *arg)
sensor_attach(&sc->sc_sensordev, &sc->sc_sensors[i]);
}
- if (sensor_task_register(sc, arc_refresh_sensors, 120) != 0)
+ if (sensor_task_register(sc, arc_refresh_sensors, 120) == NULL)
goto bad;
sensordev_install(&sc->sc_sensordev);
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index a169e83f7b0..4f16fcaf6e3 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.81 2007/06/06 23:06:02 deraadt Exp $ */
+/* $OpenBSD: softraid.c,v 1.82 2007/06/24 05:34:35 dlg Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -2362,7 +2362,7 @@ sr_create_sensors(struct sr_discipline *sd)
sensor_attach(&sd->sd_vol.sv_sensordev, &sd->sd_vol.sv_sensor);
if (sc->sc_sensors_running == 0) {
- if (sensor_task_register(sc, sr_refresh_sensors, 10) != 0)
+ if (sensor_task_register(sc, sr_refresh_sensors, 10) == NULL)
goto bad;
sc->sc_sensors_running = 1;
}