diff options
author | wes <wes@FreeBSD.org> | 2002-01-23 01:11:52 +0000 |
---|---|---|
committer | wes <wes@FreeBSD.org> | 2002-01-23 01:11:52 +0000 |
commit | 58bf98842eddac7e39ee90f910a4588a1f0128ef (patch) | |
tree | d7236a3fd4ba73019817a5a485e76413a25fd542 /sys/dev/speaker | |
parent | fa5b53e158629028233ab0498b7e7ca433088341 (diff) | |
download | FreeBSD-src-58bf98842eddac7e39ee90f910a4588a1f0128ef.zip FreeBSD-src-58bf98842eddac7e39ee90f910a4588a1f0128ef.tar.gz |
Add missing destroy_dev().
Submitted by: Maxime Henrion <mux@sneakerz.org>
Reviewed by: msmith@
MFC after: 3 weeks
Diffstat (limited to 'sys/dev/speaker')
-rw-r--r-- | sys/dev/speaker/spkr.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c index e0986de..c457906 100644 --- a/sys/dev/speaker/spkr.c +++ b/sys/dev/speaker/spkr.c @@ -588,14 +588,6 @@ spkrioctl(dev, cmd, cmdarg, flags, td) return(EINVAL); } -static void -spkr_drvinit(void *unused) -{ - make_dev(&spkr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "speaker"); -} - -SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL) - /* * Install placeholder to claim the resources owned by the * AT tone generator. @@ -605,6 +597,8 @@ static struct isa_pnp_id atspeaker_ids[] = { { 0 } }; +static dev_t atspeaker_dev; + static int atspeaker_probe(device_t dev) { @@ -614,14 +608,23 @@ atspeaker_probe(device_t dev) static int atspeaker_attach(device_t dev) { - return(0); + atspeaker_dev = make_dev(&spkr_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "speaker"); + return (0); +} + +static int +atspeaker_detach(device_t dev) +{ + destroy_dev(atspeaker_dev); + return (0); } static device_method_t atspeaker_methods[] = { /* Device interface */ DEVMETHOD(device_probe, atspeaker_probe), DEVMETHOD(device_attach, atspeaker_attach), - DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_detach, atspeaker_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), |