diff options
author | Michael Knudsen <mk@cvs.openbsd.org> | 2006-05-28 16:43:51 +0000 |
---|---|---|
committer | Michael Knudsen <mk@cvs.openbsd.org> | 2006-05-28 16:43:51 +0000 |
commit | 800b9ffd4939bb18181b35d743a55dffcf64e464 (patch) | |
tree | 84e5aa0c97b8140569eb58730a5f01908f8b8e88 | |
parent | 1fe1beb0ccb78ed31b616e13a6d85961d51274e6 (diff) |
Remove device id from hotplug events.
ok henning
-rw-r--r-- | sys/dev/hotplug.c | 8 | ||||
-rw-r--r-- | sys/kern/kern_sensors.c | 6 | ||||
-rw-r--r-- | sys/kern/subr_autoconf.c | 14 |
3 files changed, 13 insertions, 15 deletions
diff --git a/sys/dev/hotplug.c b/sys/dev/hotplug.c index e41aa87f1f2..c2bfbfe8234 100644 --- a/sys/dev/hotplug.c +++ b/sys/dev/hotplug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hotplug.c,v 1.7 2006/05/28 01:33:50 mk Exp $ */ +/* $OpenBSD: hotplug.c,v 1.8 2006/05/28 16:43:49 mk Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -60,11 +60,10 @@ hotplugattach(int count) } void -hotplug_device_attach(enum devclass class, char *name, int id) +hotplug_device_attach(enum devclass class, char *name) { struct hotplug_event he; - he.he_devid = id; he.he_type = HOTPLUG_DEVAT; he.he_devclass = class; strlcpy(he.he_devname, name, sizeof(he.he_devname)); @@ -72,11 +71,10 @@ hotplug_device_attach(enum devclass class, char *name, int id) } void -hotplug_device_detach(enum devclass class, char *name, int id) +hotplug_device_detach(enum devclass class, char *name) { struct hotplug_event he; - he.he_devid = id; he.he_type = HOTPLUG_DEVDT; he.he_devclass = class; strlcpy(he.he_devname, name, sizeof(he.he_devname)); diff --git a/sys/kern/kern_sensors.c b/sys/kern/kern_sensors.c index 9be4a2bba46..784b3280c97 100644 --- a/sys/kern/kern_sensors.c +++ b/sys/kern/kern_sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sensors.c,v 1.13 2006/05/28 03:22:35 henning Exp $ */ +/* $OpenBSD: kern_sensors.c,v 1.14 2006/05/28 16:43:50 mk Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -71,7 +71,7 @@ sensor_add(struct sensor *sens) splx(s); #if NHOTPLUG > 0 - hotplug_device_attach(DV_DULL, sens->device, sens->num); + hotplug_device_attach(DV_DULL, "sensor"); #endif } @@ -86,7 +86,7 @@ sensor_del(struct sensor *sens) splx(s); #if NHOTPLUG > 0 - hotplug_device_detach(DV_DULL, sens->device, sens->num); + hotplug_device_detach(DV_DULL, "sensor"); #endif } diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index 2d4d310d7a9..2f446b402b3 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_autoconf.c,v 1.48 2006/05/28 07:12:11 deraadt Exp $ */ +/* $OpenBSD: subr_autoconf.c,v 1.49 2006/05/28 16:43:50 mk Exp $ */ /* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */ /* @@ -397,7 +397,7 @@ config_attach(struct device *parent, void *match, void *aux, cfprint_t print) config_process_deferred_children(dev); #if NHOTPLUG > 0 if (!cold) - hotplug_device_attach(cd->cd_class, dev->dv_xname, dev->dv_unit); + hotplug_device_attach(cd->cd_class, dev->dv_xname); #endif return (dev); } @@ -489,7 +489,7 @@ config_detach(struct device *dev, int flags) struct cfdata *cf; struct cfattach *ca; struct cfdriver *cd; - int rv = 0, i, devnum = dev->dv_unit; + int rv = 0, i; #ifdef DIAGNOSTIC struct device *d; #endif @@ -563,10 +563,10 @@ config_detach(struct device *dev, int flags) for (cf = cfdata; cf->cf_driver; cf++) { if (cf->cf_driver == cd) { if (cf->cf_fstate == FSTATE_FOUND && - cf->cf_unit == devnum) + cf->cf_unit == dev->dv_unit) cf->cf_fstate = FSTATE_NOTFOUND; if (cf->cf_fstate == FSTATE_STAR && - cf->cf_unit == devnum + 1) + cf->cf_unit == dev->dv_unit + 1) cf->cf_unit--; } } @@ -580,7 +580,7 @@ config_detach(struct device *dev, int flags) /* * Remove from cfdriver's array, tell the world, and free softc. */ - cd->cd_devs[devnum] = NULL; + cd->cd_devs[dev->dv_unit] = NULL; if ((flags & DETACH_QUIET) == 0) printf("%s detached\n", dev->dv_xname); @@ -600,7 +600,7 @@ config_detach(struct device *dev, int flags) #if NHOTPLUG > 0 if (!cold) - hotplug_device_detach(cd->cd_class, devname, devnum); + hotplug_device_detach(cd->cd_class, devname); #endif /* |