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/sound | |
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/sound')
-rw-r--r-- | sys/i386/isa/sound/soundcard.c | 50 |
1 files changed, 14 insertions, 36 deletions
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c index 0c97f90..746ea9b 100644 --- a/sys/i386/isa/sound/soundcard.c +++ b/sys/i386/isa/sound/soundcard.c @@ -26,13 +26,7 @@ * SUCH DAMAGE. * */ -#include "opt_devfs.h" - #include <i386/isa/sound/sound_config.h> -#ifdef DEVFS -#include <sys/devfsext.h> -#endif /* DEVFS */ - #if NSND > 0 /* from "snd.h" */ #include "uart.h" @@ -508,7 +502,6 @@ sndattach(struct isa_device * dev) } cdevsw_add(&snd_cdevsw); -#ifdef DEVFS #define GID_SND GID_GAMES #define UID_SND UID_ROOT #define PERM_SND 0660 @@ -517,40 +510,25 @@ sndattach(struct isa_device * dev) * duplicate creation of same node failed (ie. bad cookie returned) */ if (dev->id_driver == &opldriver){ - tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ, - DV_CHR, UID_SND, GID_SND, PERM_SND, - "sequencer%r", dev->id_unit); - if (tmp) devfs_makelink(tmp, "sequencer"); + make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ, + UID_SND, GID_SND, PERM_SND, "sequencer%r", dev->id_unit); } else if (dev->id_driver == &mpudriver || dev->id_driver == &sbmididriver || dev->id_driver == &uartdriver){ - tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN, - DV_CHR, UID_SND, GID_SND, PERM_SND, - "midi%r", dev->id_unit); - if (tmp) devfs_makelink(tmp, "midi"); + make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN, + UID_SND, GID_SND, PERM_SND, "midi%r", dev->id_unit); } else { - tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP, - DV_CHR, UID_SND, GID_SND, PERM_SND, - "dsp%r", dev->id_unit); - if (tmp) devfs_makelink(tmp, "dsp"); - tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16, - DV_CHR, UID_SND, GID_SND, PERM_SND, - "dspW%r", dev->id_unit); - if (tmp) devfs_makelink(tmp, "dspW"); - tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO, - DV_CHR, UID_SND, GID_SND, PERM_SND, - "audio%r", dev->id_unit); - if (tmp) devfs_makelink(tmp, "audio"); - tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL, - DV_CHR, UID_SND, GID_SND, PERM_SND, - "mixer%r", dev->id_unit); - if (tmp) devfs_makelink(tmp, "mixer"); - tmp = devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS, - DV_CHR, UID_SND, GID_SND, PERM_SND, - "sndstat%r", dev->id_unit); - if (tmp) devfs_makelink(tmp, "sndstat"); + make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP, + UID_SND, GID_SND, PERM_SND, "dsp%r", dev->id_unit); + make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16, + UID_SND, GID_SND, PERM_SND, "dspW%r", dev->id_unit); + make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO, + UID_SND, GID_SND, PERM_SND, "audio%r", dev->id_unit); + make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL, + UID_SND, GID_SND, PERM_SND, "mixer%r", dev->id_unit); + make_dev(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS, + UID_SND, GID_SND, PERM_SND, "sndstat%r", dev->id_unit); } -#endif /* DEVFS */ return TRUE; } |