summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/snp/snp.c10
-rw-r--r--sys/i386/isa/sound/soundcard.c74
-rw-r--r--sys/kern/kern_lkm.c4
-rw-r--r--sys/kern/tty_snoop.c10
-rw-r--r--sys/kern/tty_tty.c9
5 files changed, 57 insertions, 50 deletions
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index ed9ae26..c09ccd7 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -509,15 +509,18 @@ snpselect(dev, rw, p)
return 0;
}
+#ifdef DEVFS
static void *snp_devfs_token[NSNP];
+#endif
static snp_devsw_installed = 0;
static void
snp_drvinit(void *unused)
{
dev_t dev;
- char name[32];
+#ifdef DEVFS
int i;
+#endif
if( ! snp_devsw_installed ) {
dev = makedev(CDEV_MAJOR, 0);
@@ -525,10 +528,9 @@ snp_drvinit(void *unused)
snp_devsw_installed = 1;
#ifdef DEVFS
for ( i = 0 ; i < NSNP ; i++) {
- sprintf(name,"snp%d",i);
snp_devfs_token[i] =
- devfs_add_devsw( "/", name, &snp_cdevsw, i,
- DV_CHR, 0, 0, 0600);
+ devfs_add_devswf(&snp_cdevsw, i, DV_CHR, 0, 0,
+ 0600, "snp%d", i);
}
#endif
}
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c
index be0c1cc..1747749 100644
--- a/sys/i386/isa/sound/soundcard.c
+++ b/sys/i386/isa/sound/soundcard.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: soundcard.c,v 1.40 1995/12/11 09:26:16 phk Exp $
+ * $Id: soundcard.c,v 1.41 1996/01/18 20:54:15 ache Exp $
*/
#include "sound_config.h"
@@ -55,8 +55,12 @@ static int soundcards_installed = 0; /* Number of installed
static int soundcard_configured = 0;
static struct fileinfo files[SND_NDEVS];
+
+#ifdef DEVFS
static void * snd_devfs_token[SND_NDEVS];
static void * sndstat_devfs_token;
+#endif
+
struct selinfo selinfo[SND_NDEVS >> 4];
static int sndprobe (struct isa_device *dev);
@@ -300,7 +304,6 @@ sndattach (struct isa_device *dev)
static int seq_initialized = 0;
unsigned long mem_start = 0xefffffffUL;
struct address_info hw_config;
- char name[32];
unit = driver_to_voxunit(dev->id_driver);
hw_config.io_base = dev->id_iobase;
@@ -361,54 +364,49 @@ sndattach (struct isa_device *dev)
#define SND_UID 0
#define SND_GID 13
-
- sprintf(name,"mixer%d",unit);
- snd_devfs_token[unit]=devfs_add_devsw(
- "/", name, &snd_cdevsw, (unit << 4)+SND_DEV_CTL,
- DV_CHR, SND_UID, SND_GID, 0660);
+ snd_devfs_token[unit]=
+ devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_CTL, DV_CHR,
+ SND_UID, SND_GID, 0660, "mixer%d", unit);
#ifndef EXCLUDE_SEQUENCER
- sprintf(name,"sequencer%d",unit);
- snd_devfs_token[unit]=devfs_add_devsw(
- "/", name, &snd_cdevsw, (unit << 4)+SND_DEV_SEQ,
- DV_CHR, SND_UID, SND_GID, 0660);
- sprintf(name,"music%d",unit);
- snd_devfs_token[unit]=devfs_add_devsw(
- "/", name, &snd_cdevsw, (unit << 4)+SND_DEV_SEQ2,
- DV_CHR, SND_UID, SND_GID, 0660);
+ snd_devfs_token[unit]=
+ devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_SEQ, DV_CHR,
+ SND_UID, SND_GID, 0660, "sequencer%d", unit);
+ snd_devfs_token[unit]=
+ devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_SEQ2, DV_CHR,
+ SND_UID, SND_GID, 0660, "music%d", unit);
#endif
#ifndef EXCLUDE_MIDI
- sprintf(name,"midi%d",unit);
- snd_devfs_token[unit]=devfs_add_devsw(
- "/", name, &snd_cdevsw, (unit << 4)+SND_DEV_MIDIN,
- DV_CHR, SND_UID, SND_GID, 0660);
+ snd_devfs_token[unit]=
+ devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_MIDIN,
+ DV_CHR, SND_UID, SND_GID, 0660, "midi%d",
+ unit);
#endif
#ifndef EXCLUDE_AUDIO
- sprintf(name,"dsp%d",unit);
- snd_devfs_token[unit]=devfs_add_devsw(
- "/", name, &snd_cdevsw, (unit << 4)+SND_DEV_DSP,
- DV_CHR, SND_UID, SND_GID, 0660);
- sprintf(name,"audio%d",unit);
- snd_devfs_token[unit]=devfs_add_devsw(
- "/", name, &snd_cdevsw, (unit << 4)+SND_DEV_AUDIO,
- DV_CHR, SND_UID, SND_GID, 0660);
- sprintf(name,"dspW%d",unit);
- snd_devfs_token[unit]=devfs_add_devsw(
- "/", name, &snd_cdevsw, (unit << 4)+SND_DEV_DSP16,
- DV_CHR, SND_UID, SND_GID, 0660);
+ snd_devfs_token[unit]=
+ devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_DSP, DV_CHR,
+ SND_UID, SND_GID, 0660, "dsp%d", unit);
+ snd_devfs_token[unit]=
+ devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_AUDIO,
+ DV_CHR, SND_UID, SND_GID, 0660, "audio%d",
+ unit);
+ snd_devfs_token[unit]=
+ devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_DSP16,
+ DV_CHR, SND_UID, SND_GID, 0660, "dspW%d",
+ unit);
#endif
- sprintf(name,"pss%d",unit);
- snd_devfs_token[unit]=devfs_add_devsw(
- "/", name, &snd_cdevsw, (unit << 4)+SND_DEV_SNDPROC,
- DV_CHR, SND_UID, SND_GID, 0660);
+ snd_devfs_token[unit]=
+ devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_SNDPROC,
+ DV_CHR, SND_UID, SND_GID, 0660, "pss%d",
+ unit);
if ( ! sndstat_devfs_token) {
- sndstat_devfs_token = devfs_add_devsw(
- "/", "sndstat", &snd_cdevsw, 6,
- DV_CHR, SND_UID, SND_GID, 0660);
+ sndstat_devfs_token =
+ devfs_add_devswf(&snd_cdevsw, 6, DV_CHR, SND_UID, SND_GID,
+ 0660, "sndstat");
}
#endif /* DEVFS */
return TRUE;
diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c
index 2d64026a..85ade24 100644
--- a/sys/kern/kern_lkm.c
+++ b/sys/kern/kern_lkm.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_lkm.c,v 1.27 1995/12/16 00:01:40 bde Exp $
+ * $Id: kern_lkm.c,v 1.28 1996/03/27 19:42:14 bde Exp $
*/
#include <sys/param.h>
@@ -906,7 +906,9 @@ lkm_nullcmd(lkmtp, cmd)
}
static lkm_devsw_installed = 0;
+#ifdef DEVFS
static void *lkmc_devfs_token;
+#endif
static void lkm_drvinit(void *unused)
{
diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c
index ed9ae26..c09ccd7 100644
--- a/sys/kern/tty_snoop.c
+++ b/sys/kern/tty_snoop.c
@@ -509,15 +509,18 @@ snpselect(dev, rw, p)
return 0;
}
+#ifdef DEVFS
static void *snp_devfs_token[NSNP];
+#endif
static snp_devsw_installed = 0;
static void
snp_drvinit(void *unused)
{
dev_t dev;
- char name[32];
+#ifdef DEVFS
int i;
+#endif
if( ! snp_devsw_installed ) {
dev = makedev(CDEV_MAJOR, 0);
@@ -525,10 +528,9 @@ snp_drvinit(void *unused)
snp_devsw_installed = 1;
#ifdef DEVFS
for ( i = 0 ; i < NSNP ; i++) {
- sprintf(name,"snp%d",i);
snp_devfs_token[i] =
- devfs_add_devsw( "/", name, &snp_cdevsw, i,
- DV_CHR, 0, 0, 0600);
+ devfs_add_devswf(&snp_cdevsw, i, DV_CHR, 0, 0,
+ 0600, "snp%d", i);
}
#endif
}
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index 6440014..3139f5a 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tty_tty.c 8.2 (Berkeley) 9/23/93
- * $Id: tty_tty.c,v 1.9 1995/12/08 23:21:37 phk Exp $
+ * $Id: tty_tty.c,v 1.10 1995/12/22 15:57:31 bde Exp $
*/
/*
@@ -173,7 +173,9 @@ cttyselect(dev, flag, p)
}
static ctty_devsw_installed = 0;
+#ifdef DEVFS
static void *ctty_devfs_token;
+#endif
static void
ctty_drvinit(void *unused)
@@ -185,8 +187,9 @@ ctty_drvinit(void *unused)
cdevsw_add(&dev,&ctty_cdevsw,NULL);
ctty_devsw_installed = 1;
#ifdef DEVFS
- ctty_devfs_token = devfs_add_devsw( "/", "tty",
- &ctty_cdevsw, 0, DV_CHR, 0, 0, 0666);
+ ctty_devfs_token =
+ devfs_add_devswf(&ctty_cdevsw, 0, DV_CHR, 0, 0,
+ 0666, "tty");
#endif
}
}
OpenPOWER on IntegriCloud