diff options
author | nyan <nyan@FreeBSD.org> | 2002-01-31 04:22:20 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2002-01-31 04:22:20 +0000 |
commit | 9e96f2c1278b382b8ed7a64b0cc7aa00cf822428 (patch) | |
tree | d0a9586f3822fdb1ec86ebbf94c0d10738f5f247 | |
parent | b0b42236aa80431126dabf63f36ef60686a66444 (diff) | |
download | FreeBSD-src-9e96f2c1278b382b8ed7a64b0cc7aa00cf822428.zip FreeBSD-src-9e96f2c1278b382b8ed7a64b0cc7aa00cf822428.tar.gz |
MFi386: revision 1.52
-rw-r--r-- | sys/pc98/pc98/spkr.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/pc98/pc98/spkr.c b/sys/pc98/pc98/spkr.c index 7b8f4b2..9393ad2 100644 --- a/sys/pc98/pc98/spkr.c +++ b/sys/pc98/pc98/spkr.c @@ -622,14 +622,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. @@ -639,6 +631,8 @@ static struct isa_pnp_id atspeaker_ids[] = { { 0 } }; +static dev_t atspeaker_dev; + static int atspeaker_probe(device_t dev) { @@ -648,14 +642,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), |