summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-01-10 15:41:28 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-01-10 15:41:28 +0000
commit9f177629927c4e4c0e31c5f26e568aa7f613af16 (patch)
tree0192e7a9e1cf385e3ffa9bceead32b1bc4be6a4c /sys/arch/i386
parent69b00db8bef66a48f166765aad29fcaf37795f4b (diff)
fix fallout of the split sensor devices change which caused lockups on
boot. dont call sensordev_install multiple times for esm0. there are multiple devices accessed via the one esm interface that provide sensor info for various parts of the system. sensordev_install was being called after each of these parts was being probed, rather than right at the end after the entire list of sensors has been built. tested by kurt@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/esm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/esm.c b/sys/arch/i386/i386/esm.c
index bd3e25e4c80..c1108297604 100644
--- a/sys/arch/i386/i386/esm.c
+++ b/sys/arch/i386/i386/esm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esm.c,v 1.44 2006/12/23 17:46:39 deraadt Exp $ */
+/* $OpenBSD: esm.c,v 1.45 2007/01/10 15:41:27 dlg Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -257,6 +257,8 @@ esm_attach(struct device *parent, struct device *self, void *aux)
wdog_register(sc, esm_watchdog);
printf("\n");
+ strlcpy(sc->sc_sensordev.xname, DEVNAME(sc),
+ sizeof(sc->sc_sensordev.xname));
for (i = 0; i <= 0xff; i++) {
if (esm_get_devmap(sc, i, &devmap) != 0)
break; /* XXX not continue? */
@@ -264,6 +266,7 @@ esm_attach(struct device *parent, struct device *self, void *aux)
}
if (!TAILQ_EMPTY(&sc->sc_sensors)) {
+ sensordev_install(&sc->sc_sensordev);
DPRINTF("%s: starting refresh\n", DEVNAME(sc));
sc->sc_nextsensor = TAILQ_FIRST(&sc->sc_sensors);
sc->sc_retries = 0;
@@ -927,13 +930,10 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap,
break;
}
- strlcpy(sc->sc_sensordev.xname, DEVNAME(sc),
- sizeof(sc->sc_sensordev.xname));
for (j = 0; j < nsensors; j++) {
s[j].type = esm_typemap[es->es_type];
sensor_attach(&sc->sc_sensordev, &s[j]);
}
- sensordev_install(&sc->sc_sensordev);
es->es_sensor = s;
TAILQ_INSERT_TAIL(&sc->sc_sensors, es, es_entry);