diff options
author | phk <phk@FreeBSD.org> | 1999-08-23 20:59:21 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-08-23 20:59:21 +0000 |
commit | 663cbe4fc26065f7af7d10faaee492a626156145 (patch) | |
tree | 32e619fadb473bfb85ff8e06044176f2ff323cce /sys/i386/isa/snd/sound.c | |
parent | 2a5ff1f726f814a9e4717afe3f14250f8030cace (diff) | |
download | FreeBSD-src-663cbe4fc26065f7af7d10faaee492a626156145.zip FreeBSD-src-663cbe4fc26065f7af7d10faaee492a626156145.tar.gz |
Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.
Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)
Add the correct hook for devfs to kern_conf.c
The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.
A few drivers had minor additional cleanups performed relating to cdevsw
registration.
A few drivers don't register a cdevsw{} anymore, but only use make_dev().
Diffstat (limited to 'sys/i386/isa/snd/sound.c')
-rw-r--r-- | sys/i386/isa/snd/sound.c | 54 |
1 files changed, 11 insertions, 43 deletions
diff --git a/sys/i386/isa/snd/sound.c b/sys/i386/isa/snd/sound.c index 6737ee5..4e2062f 100644 --- a/sys/i386/isa/snd/sound.c +++ b/sys/i386/isa/snd/sound.c @@ -50,12 +50,7 @@ * */ -#include "opt_devfs.h" - #include <i386/isa/snd/sound.h> -#ifdef DEVFS -#include <sys/devfsext.h> -#endif /* DEVFS */ #if NPCM > 0 /* from "pcm.h" via disgusting #include in snd/sound.h */ @@ -337,10 +332,6 @@ pcmattach(struct isa_device * dev) int pcminit(snddev_info *d, int unit) { -#ifdef DEVFS - void *cookie; -#endif - cdevsw_add(&snd_cdevsw); /* @@ -354,7 +345,6 @@ pcminit(snddev_info *d, int unit) d->play_blocksize = d->rec_blocksize = 2048 ; d->play_fmt = d->rec_fmt = AFMT_MU_LAW ; -#ifdef DEVFS #ifndef GID_GAMES #define GID_SND UID_ROOT #else @@ -363,42 +353,20 @@ pcminit(snddev_info *d, int unit) #define UID_SND UID_ROOT #define PERM_SND 0660 /* - * XXX remember to store the returned tokens if you want to - * be able to remove the device later - * * Make links to first successfully probed unit. * Attempts by later devices to make these links will fail. */ - cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_DSP, - DV_CHR, UID_SND, GID_SND, PERM_SND, "dsp%r", unit); - if (cookie) devfs_makelink(cookie, "dsp"); - - cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_DSP16, - DV_CHR, UID_SND, GID_SND, PERM_SND, "dspW%r", unit); - if (cookie) devfs_makelink(cookie, "dspW"); - - cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_AUDIO, - DV_CHR, UID_SND, GID_SND, PERM_SND, "audio%r", unit); - if (cookie) devfs_makelink(cookie, "audio"); - - cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_CTL, - DV_CHR, UID_SND, GID_SND, PERM_SND, "mixer%r", unit); - if (cookie) devfs_makelink(cookie, "mixer"); - - cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_STATUS, - DV_CHR, UID_SND, GID_SND, PERM_SND, "sndstat%r", unit); - if (cookie) devfs_makelink(cookie, "sndstat"); - -#if 0 /* these two are still unsupported... */ - cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_MIDIN, - DV_CHR, UID_SND, GID_SND, PERM_SND, "midi%r", unit); - if (cookie) devfs_makelink(cookie, "midi"); - - cookie = devfs_add_devswf(&snd_cdevsw, (unit << 4) | SND_DEV_SYNTH, - DV_CHR, UID_SND, GID_SND, PERM_SND, "sequencer%r", unit); - if (cookie) devfs_makelink(cookie, "sequencer"); -#endif -#endif /* DEVFS */ + make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_DSP, + UID_SND, GID_SND, PERM_SND, "dsp%r", unit); + make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_DSP16, + UID_SND, GID_SND, PERM_SND, "dspW%r", unit); + make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_AUDIO, + UID_SND, GID_SND, PERM_SND, "audio%r", unit); + make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_CTL, + UID_SND, GID_SND, PERM_SND, "mixer%r", unit); + make_dev(&snd_cdevsw, (unit << 4) | SND_DEV_STATUS, + UID_SND, GID_SND, PERM_SND, "sndstat%r", unit); + #if NAPM > 0 init_sound_apm(unit); #endif |