From 6e18ce467629720239a3dbefe42ee64bc0c2034a Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Thu, 28 Mar 1996 14:29:52 +0000 Subject: [PATCH] Switched from using devfs_add_sw() to using devfs_add_swf() Reviewed by: julian@freebsd.org --- sys/dev/dgb/dgb.c | 39 ++++++++++++++++++++------------------ sys/dev/fdc/fdc.c | 17 +++++++++-------- sys/dev/joy/joy.c | 8 +++----- sys/dev/mcd/mcd.c | 34 +++++++++++++-------------------- sys/dev/mse/mse.c | 19 +++++++------------ sys/dev/rc/rc.c | 10 +++++----- sys/dev/scd/scd.c | 34 +++++++++++++-------------------- sys/dev/si/si.c | 8 ++++---- sys/gnu/i386/isa/dgb.c | 39 ++++++++++++++++++++------------------ sys/gnu/i386/isa/nic3008.c | 14 ++++++++------ sys/gnu/i386/isa/nic3009.c | 14 ++++++++------ sys/gnu/isdn/iispy.c | 11 +++++------ sys/gnu/isdn/iitel.c | 11 +++++------ sys/gnu/isdn/iitty.c | 17 ++++++++--------- sys/i386/apm/apm.c | 8 +++++--- sys/i386/bios/apm.c | 8 +++++--- sys/i386/i386/cons.c | 14 ++++---------- sys/i386/isa/asc.c | 34 ++++++++++++++------------------- sys/i386/isa/b004.c | 29 ++++++++++++---------------- sys/i386/isa/ctx.c | 9 ++++----- sys/i386/isa/fd.c | 17 +++++++++-------- sys/i386/isa/gpib.c | 4 ++-- sys/i386/isa/gsc.c | 29 +++++++++++++--------------- sys/i386/isa/if_cx.c | 13 +++++++------ sys/i386/isa/joy.c | 8 +++----- sys/i386/isa/labpc.c | 11 +++++------ sys/i386/isa/lpt.c | 10 ++++------ sys/i386/isa/matcd/matcd.c | 39 +++++++++++++++++--------------------- sys/i386/isa/mcd.c | 34 +++++++++++++-------------------- sys/i386/isa/mse.c | 19 +++++++------------ sys/i386/isa/pcaudio.c | 15 +++++++++------ sys/i386/isa/psm.c | 17 ++++++----------- sys/i386/isa/qcam.c | 9 +++------ sys/i386/isa/rc.c | 10 +++++----- sys/i386/isa/scd.c | 34 +++++++++++++-------------------- sys/i386/isa/si.c | 8 ++++---- sys/i386/isa/spigot.c | 9 +++------ sys/i386/isa/tw.c | 8 +++----- sys/i386/isa/wcd.c | 32 ++++++++++++------------------- sys/i386/isa/wt.c | 17 +++++++---------- sys/isa/fd.c | 17 +++++++++-------- sys/isa/joy.c | 8 +++----- sys/kern/tty_cons.c | 14 ++++---------- 43 files changed, 335 insertions(+), 424 deletions(-) diff --git a/sys/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c index 42810f06dc25..ec67dce07afd 100644 --- a/sys/dev/dgb/dgb.c +++ b/sys/dev/dgb/dgb.c @@ -1,5 +1,5 @@ /*- - * dgb.c $Id: dgb.c,v 1.14 1995/12/17 21:14:29 phk Exp $ + * dgb.c $Id: dgb.c,v 1.15 1995/12/29 13:21:10 bde Exp $ * * Digiboard driver. * @@ -457,7 +457,6 @@ dgbattach(dev) ushort *pstat; int lowwater; int nports=0; - char name[32]; if(sc->status!=ENABLED) { DPRINT2("dbg%d: try to attach a disabled card\n",unit); @@ -855,25 +854,29 @@ dgbattach(dev) port->it_out = port->it_in; #ifdef DEVFS /*XXX*/ /* fix the minor numbers */ - sprintf(name,"dgb%d.%d",unit,i); - port->devfs_token.tty = devfs_add_devsw("/",name, - &dgb_cdevsw,(unit*32)+i, /*mytical number */ - DV_CHR, 0, 0, 0600); + port->devfs_token.tty = + devfs_add_devswf(&dgb_cdevsw, + (unit*32)+i,/*mytical number*/ + DV_CHR, 0, 0, 0600, "dgb%d.%d", unit, + i); - sprintf(name,"idgb%d.%d",unit,i); - port->devfs_token.tty = devfs_add_devsw("/",name, - &dgb_cdevsw,(unit*32)+i + 64, /*mytical number */ - DV_CHR, 0, 0, 0600); + port->devfs_token.tty = + devfs_add_devswf(&dgb_cdevsw, + (unit*32)+i+64,/*mytical number*/ + DV_CHR, 0, 0, 0600, idgb%d.%d", unit, + i); - sprintf(name,"ldgb%d.%d",unit,i); - port->devfs_token.tty = devfs_add_devsw("/",name, - &dgb_cdevsw,(unit*32)+i + 128, /*mytical number */ - DV_CHR, 0, 0, 0600); + port->devfs_token.tty = + devfs_add_devswf(&dgb_cdevsw, + (unit*32)+i+128,/*mytical number*/ + DV_CHR, 0, 0, 0600, "ldgb%d.%d", unit, + i); - sprintf(name,"dgbcua%d.%d",unit,i); - port->devfs_token.tty = devfs_add_devsw("/",name, - &dgb_cdevsw,(unit*32)+i + 192, /*mytical number */ - DV_CHR, 0, 0, 0600); + port->devfs_token.tty = + devfs_add_devswf(&dgb_cdevsw, + (unit*32)+i+192,/*mytical number*/ + DV_CHR, 0, 0, 0600, "dgbcua%d.%d", + unit, i); #endif } diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index f62c6baadf84..3c666a660c71 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.79 1996/01/27 04:17:50 bde Exp $ + * $Id: fd.c,v 1.80 1996/02/25 21:01:31 bde Exp $ * */ @@ -767,13 +767,14 @@ fdattach(struct isa_device *dev) kdc_fd[fdu].kdc_state = DC_IDLE; #ifdef DEVFS mynor = 8 * fdu; - fd->bdev = devfs_add_devsw("/", name + 1, &fd_bdevsw, mynor, - DV_BLK, 0, 0, 0640); - fd->cdev = devfs_add_devsw("/", name, &fd_cdevsw, mynor, - DV_CHR, 0, 0, 0640); - sprintf(name, "rfd%d", fdu); - dev_link("/", name + 1, fd->bdev); - dev_link("/", name, fd->cdev); + fd->bdev = + devfs_add_devswf(&fd_bdevsw, mynor, DV_BLK, 0, 0, + 0640, name + 1); + fd->cdev = + devfs_add_devswf(&fd_cdevsw, mynor, + DV_CHR, 0, 0, 0640, name); + dev_link(fd->bdev, "fd%d", fdu); + dev_link(fd->cdev, "rfd%d", fdu); #endif /* DEVFS */ if (dk_ndrive < DK_NDRIVE) { sprintf(dk_names[dk_ndrive], "fd%d", fdu); diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c index ffb615d8a44a..350d7846d840 100644 --- a/sys/dev/joy/joy.c +++ b/sys/dev/joy/joy.c @@ -115,16 +115,14 @@ static int joyattach (struct isa_device *dev) { int unit = dev->id_unit; - char name[32]; joy[unit].port = dev->id_iobase; joy[unit].timeout[0] = joy[unit].timeout[1] = 0; printf("joy%d: joystick\n", unit); #ifdef DEVFS - sprintf(name, "joy%d", unit); - joy[dev->id_unit].devfs_token = devfs_add_devsw( "/", "joy", - &joy_cdevsw, 0, - DV_CHR, 0, 0, 0600); + joy[dev->id_unit].devfs_token = + devfs_add_devswf(&joy_cdevsw, 0, DV_CHR, 0, 0, + 0600, "joy%d", unit); #endif return 1; } diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c index 645a7eb95a45..a364c041dd4d 100644 --- a/sys/dev/mcd/mcd.c +++ b/sys/dev/mcd/mcd.c @@ -40,7 +40,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.73 1996/02/27 19:08:39 ache Exp $ + * $Id: mcd.c,v 1.74 1996/03/17 13:33:42 ache Exp $ */ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -275,7 +275,6 @@ int mcd_attach(struct isa_device *dev) { int unit = dev->id_unit; struct mcd_data *cd = mcd_data + unit; - char name[32]; cd->iobase = dev->id_iobase; cd->flags |= MCDINIT; @@ -291,25 +290,18 @@ int mcd_attach(struct isa_device *dev) #ifdef DEVFS #define MCD_UID 0 #define MCD_GID 13 - sprintf(name, "rmcd%da",unit); - cd->ra_devfs_token = devfs_add_devsw( - "/", name, &mcd_cdevsw, (unit * 8 ) + 0, - DV_CHR, MCD_UID, MCD_GID, 0600); - - sprintf(name, "rmcd%dc",unit); - cd->rc_devfs_token = devfs_add_devsw( - "/", name, &mcd_cdevsw, (unit * 8 ) + RAW_PART, - DV_CHR, MCD_UID, MCD_GID, 0600); - - sprintf(name, "mcd%da",unit); - cd->a_devfs_token = devfs_add_devsw( - "/", name, &mcd_bdevsw, (unit * 8 ) + 0, - DV_BLK, MCD_UID, MCD_GID, 0600); - - sprintf(name, "mcd%dc",unit); - cd->c_devfs_token = devfs_add_devsw( - "/", name, &mcd_bdevsw, (unit * 8 ) + RAW_PART, - DV_BLK, MCD_UID, MCD_GID, 0600); + cd->ra_devfs_token = + devfs_add_devswf(&mcd_cdevsw, (unit * 8 ) + 0, DV_CHR, MCD_UID, + MCD_GID, 0600, "rmcd%da", unit); + cd->rc_devfs_token = + devfs_add_devswf(&mcd_cdevsw, (unit * 8 ) + RAW_PART, DV_CHR, + MCD_UID, MCD_GID, 0600, "rmcd%dc", unit); + cd->a_devfs_token = + devfs_add_devswf(&mcd_bdevsw, (unit * 8 ) + 0, DV_BLK, MCD_UID, + MCD_GID, 0600, "mcd%da", unit); + cd->c_devfs_token = + devfs_add_devswf(&mcd_bdevsw, (unit * 8 ) + RAW_PART, DV_BLK, + MCD_UID, MCD_GID, 0600, "mcd%dc", unit); #endif return 1; } diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c index 01df8501164a..efa306500403 100644 --- a/sys/dev/mse/mse.c +++ b/sys/dev/mse/mse.c @@ -11,7 +11,7 @@ * this software for any purpose. It is provided "as is" * without express or implied warranty. * - * $Id: mse.c,v 1.23 1995/12/15 00:29:30 bde Exp $ + * $Id: mse.c,v 1.24 1995/12/15 00:54:25 bde Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -257,23 +257,18 @@ int mseattach(idp) struct isa_device *idp; { - char name[32]; int unit = idp->id_unit; struct mse_softc *sc = &mse_sc[unit]; sc->sc_port = idp->id_iobase; kdc_mse[unit].kdc_state = DC_IDLE; #ifdef DEVFS - sprintf(name,"mse%d", unit); - /* path name devsw minor */ - sc->devfs_token = devfs_add_devsw( "/", name, &mse_cdevsw, unit << 1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0600); - sprintf(name,"nmse%d", unit); - /* path name devsw minor */ - sc->n_devfs_token = devfs_add_devsw("/", name, &mse_cdevsw, (unit<<1)+1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&mse_cdevsw, unit << 1, DV_CHR, 0, 0, + 0600, "mse%d", unit); + sc->n_devfs_token = + devfs_add_devswf(&mse_cdevsw, (unit<<1)+1, DV_CHR,0, 0, + 0600, "nmse%d", unit); #endif return (1); } diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c index 7844e4de8566..d05b42359729 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/rc.c @@ -263,7 +263,6 @@ rcattach(dvp) struct rc_chans *rc = &rc_chans[dvp->id_unit * CD180_NCHAN]; static int rc_wakeup_started = 0; struct tty *tp; - char name[32]; /* Thorooughly test the device */ if (rcb->rcb_probed != RC_PROBED) @@ -296,10 +295,11 @@ rcattach(dvp) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; #ifdef DEVFS /* FIX THIS to reflect real devices */ - sprintf(name,"rc%d.%d",dvp->id_unit,chan); - rc->devfs_token = devfs_add_devsw( "/", name, - &rc_cdevsw,(dvp->id_unit * CD180_NCHAN) + chan , - DV_CHR, 0, 0, 0600); + rc->devfs_token = + devfs_add_devswf(&rc_cdevsw, + (dvp->id_unit * CD180_NCHAN) + chan, + DV_CHR, 0, 0, 0600, "rc%d.%d", + dvp->id_unit, chan); #endif } rcb->rcb_probed = RC_ATTACHED; diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c index b313491741d7..e8a6982d7f93 100644 --- a/sys/dev/scd/scd.c +++ b/sys/dev/scd/scd.c @@ -41,7 +41,7 @@ */ -/* $Id: scd.c,v 1.16 1995/12/10 20:10:23 bde Exp $ */ +/* $Id: scd.c,v 1.17 1996/01/15 10:28:32 phk Exp $ */ /* Please send any comments to micke@dynas.se */ @@ -232,7 +232,6 @@ int scd_attach(struct isa_device *dev) { int unit = dev->id_unit; struct scd_data *cd = scd_data + unit; - char name[32]; cd->iobase = dev->id_iobase; /* Already set by probe, but ... */ @@ -249,25 +248,18 @@ int scd_attach(struct isa_device *dev) #ifdef DEVFS #define SCD_UID 0 #define SCD_GID 13 - sprintf(name, "rscd%da",unit); - cd->ra_devfs_token = devfs_add_devsw( - "/", name, &scd_cdevsw, (unit * 8 ) + 0, - DV_CHR, SCD_UID, SCD_GID, 0600); - - sprintf(name, "rscd%dc",unit); - cd->rc_devfs_token = devfs_add_devsw( - "/", name, &scd_cdevsw, (unit * 8 ) + RAW_PART, - DV_CHR, SCD_UID, SCD_GID, 0600); - - sprintf(name, "scd%da",unit); - cd->a_devfs_token = devfs_add_devsw( - "/", name, &scd_bdevsw, (unit * 8 ) + 0, - DV_BLK, SCD_UID, SCD_GID, 0600); - - sprintf(name, "scd%dc",unit); - cd->c_devfs_token = devfs_add_devsw( - "/", name, &scd_bdevsw, (unit * 8 ) + RAW_PART, - DV_BLK, SCD_UID, SCD_GID, 0600); + cd->ra_devfs_token = + devfs_add_devswf(&scd_cdevsw, (unit * 8 ) + 0, DV_CHR, SCD_UID, + SCD_GID, 0600, "rscd%da", unit); + cd->rc_devfs_token = + devfs_add_devswf(&scd_cdevsw, (unit * 8 ) + RAW_PART, DV_CHR, + SCD_UID, SCD_GID, 0600, "rscd%dc", unit); + cd->a_devfs_token = + devfs_add_devswf(&scd_bdevsw, (unit * 8 ) + 0, DV_BLK, SCD_UID, + SCD_GID, 0600, "scd%da", unit); + cd->c_devfs_token = + devfs_add_devswf(&scd_bdevsw, (unit * 8 ) + RAW_PART, DV_BLK, + SCD_UID, SCD_GID, 0600, "scd%dc", unit); #endif return 1; } diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index 8be544f88279..faef542ea8ea 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -30,7 +30,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHORS BE LIABLE. * - * $Id: si.c,v 1.35 1996/01/16 18:13:18 phk Exp $ + * $Id: si.c,v 1.36 1996/01/25 07:21:33 phk Exp $ */ #ifndef lint @@ -710,9 +710,9 @@ siattach(id) &si_cdevsw, x + 0x20000, DV_CHR, 0, 0, 0600, "ttylA%02d", y); } - sc->control_token = devfs_add_devsw("/", "si_control", - &si_cdevsw, 0x40000, - DV_CHR, 0, 0, 0600); + sc->control_token = + devfs_add_devswf(&si_cdevsw, 0x40000, DV_CHR, 0, 0, 0600, + "si_control"); #endif return (1); } diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c index 42810f06dc25..ec67dce07afd 100644 --- a/sys/gnu/i386/isa/dgb.c +++ b/sys/gnu/i386/isa/dgb.c @@ -1,5 +1,5 @@ /*- - * dgb.c $Id: dgb.c,v 1.14 1995/12/17 21:14:29 phk Exp $ + * dgb.c $Id: dgb.c,v 1.15 1995/12/29 13:21:10 bde Exp $ * * Digiboard driver. * @@ -457,7 +457,6 @@ dgbattach(dev) ushort *pstat; int lowwater; int nports=0; - char name[32]; if(sc->status!=ENABLED) { DPRINT2("dbg%d: try to attach a disabled card\n",unit); @@ -855,25 +854,29 @@ dgbattach(dev) port->it_out = port->it_in; #ifdef DEVFS /*XXX*/ /* fix the minor numbers */ - sprintf(name,"dgb%d.%d",unit,i); - port->devfs_token.tty = devfs_add_devsw("/",name, - &dgb_cdevsw,(unit*32)+i, /*mytical number */ - DV_CHR, 0, 0, 0600); + port->devfs_token.tty = + devfs_add_devswf(&dgb_cdevsw, + (unit*32)+i,/*mytical number*/ + DV_CHR, 0, 0, 0600, "dgb%d.%d", unit, + i); - sprintf(name,"idgb%d.%d",unit,i); - port->devfs_token.tty = devfs_add_devsw("/",name, - &dgb_cdevsw,(unit*32)+i + 64, /*mytical number */ - DV_CHR, 0, 0, 0600); + port->devfs_token.tty = + devfs_add_devswf(&dgb_cdevsw, + (unit*32)+i+64,/*mytical number*/ + DV_CHR, 0, 0, 0600, idgb%d.%d", unit, + i); - sprintf(name,"ldgb%d.%d",unit,i); - port->devfs_token.tty = devfs_add_devsw("/",name, - &dgb_cdevsw,(unit*32)+i + 128, /*mytical number */ - DV_CHR, 0, 0, 0600); + port->devfs_token.tty = + devfs_add_devswf(&dgb_cdevsw, + (unit*32)+i+128,/*mytical number*/ + DV_CHR, 0, 0, 0600, "ldgb%d.%d", unit, + i); - sprintf(name,"dgbcua%d.%d",unit,i); - port->devfs_token.tty = devfs_add_devsw("/",name, - &dgb_cdevsw,(unit*32)+i + 192, /*mytical number */ - DV_CHR, 0, 0, 0600); + port->devfs_token.tty = + devfs_add_devswf(&dgb_cdevsw, + (unit*32)+i+192,/*mytical number*/ + DV_CHR, 0, 0, 0600, "dgbcua%d.%d", + unit, i); #endif } diff --git a/sys/gnu/i386/isa/nic3008.c b/sys/gnu/i386/isa/nic3008.c index 27bd01bedfd4..b3b890749531 100644 --- a/sys/gnu/i386/isa/nic3008.c +++ b/sys/gnu/i386/isa/nic3008.c @@ -1,6 +1,6 @@ -static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.13 1995/12/08 23:19:29 phk Exp $"; +static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.14 1995/12/17 21:14:34 phk Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.13 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.14 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -10,6 +10,9 @@ static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.13 1995/12/08 23:19:29 phk * ******************************************************************************* * $Log: nic3008.c,v $ + * Revision 1.14 1995/12/17 21:14:34 phk + * Staticize. + * * Revision 1.13 1995/12/08 23:19:29 phk * Julian forgot to make the *devsw structures static. * @@ -265,7 +268,6 @@ nicattach(struct isa_device * is) dpr_type *dpr; int cn; isdn_ctrl_t *ctrl0, *ctrl1; - char name[32]; sc = &nic_sc[is->id_unit]; dpr = sc->sc_dpr; @@ -298,9 +300,9 @@ nicattach(struct isa_device * is) dpr->int_flg_pc = 0xff; reset_req(sc, MBX_MU, 4); #ifdef DEVFS - sprintf(name,"nic%d",is->id_unit); - sc->devfs_token = devfs_add_devsw( "/isdn", name, - &nic_cdevsw,is->id_unit, DV_CHR, 0, 0, 0600 ); + sc->devfs_token = + devfs_add_devswf(&nic_cdevsw, is->id_unit, DV_CHR, 0, 0, + 0600, "/isdn/nic%d", is->id_unit); #endif return (1); } diff --git a/sys/gnu/i386/isa/nic3009.c b/sys/gnu/i386/isa/nic3009.c index 75d0440329fc..314b645af53d 100644 --- a/sys/gnu/i386/isa/nic3009.c +++ b/sys/gnu/i386/isa/nic3009.c @@ -1,6 +1,6 @@ -static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.13 1995/12/08 23:19:30 phk Exp $"; +static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.14 1995/12/17 21:14:36 phk Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.13 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.14 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -10,6 +10,9 @@ static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.13 1995/12/08 23:19:30 phk * ******************************************************************************* * $Log: nic3009.c,v $ + * Revision 1.14 1995/12/17 21:14:36 phk + * Staticize. + * * Revision 1.13 1995/12/08 23:19:30 phk * Julian forgot to make the *devsw structures static. * @@ -271,7 +274,6 @@ nnicattach(struct isa_device * is) struct nnic_softc *sc; int cn; isdn_ctrl_t *ctrl0, *ctrl1; - char name[32]; sc = &nnic_sc[is->id_unit]; sc->sc_ctrl = -1; @@ -299,9 +301,9 @@ nnicattach(struct isa_device * is) ctrl0->o_len = ctrl1->o_len = -1; sc->sc_flags= LOAD_ENTITY; #ifdef DEVFS - sprintf(name,"nnic%d",is->id_unit); - sc->devfs_token = devfs_add_devsw("/isdn",name, - &nnic_cdevsw, is->id_unit, DV_CHR, 0, 0, 0600 ); + sc->devfs_token = + devfs_add_devswf(&nnic_cdevsw, is->id_unit, DV_CHR, 0, 0, + 0600, "/isdn/nnic%d", is->id_unit); #endif return (1); diff --git a/sys/gnu/isdn/iispy.c b/sys/gnu/isdn/iispy.c index 502e765b60f6..170281b836b1 100644 --- a/sys/gnu/isdn/iispy.c +++ b/sys/gnu/isdn/iispy.c @@ -1,6 +1,6 @@ -static char _ispyid[] = "@(#)$Id: iispy.c,v 1.9 1995/12/08 23:19:40 phk Exp $"; +static char _ispyid[] = "@(#)$Id: iispy.c,v 1.10 1995/12/17 21:17:43 phk Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.9 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.10 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -74,7 +74,6 @@ static struct cdevsw ispy_cdevsw = int ispyattach(int ap) { - char name[32]; struct ispy_data *ispy; if(next_if >= NISPY) @@ -83,9 +82,9 @@ ispyattach(int ap) ispy->state= 0; ispy_applnr= ap; #ifdef DEVFS - sprintf(name,"ispy%d",next_if); - ispy->devfs_token =devfs_add_devsw("/isdn",name,&ispy_cdevsw,next_if, - DV_CHR, 0, 0, 0600); + ispy->devfs_token = + devfs_add_devswf(&ispy_cdevsw, next_if, DV_CHR, 0, 0, + 0600, "isdn/ispy%d", next_if); #endif return(next_if++); } diff --git a/sys/gnu/isdn/iitel.c b/sys/gnu/isdn/iitel.c index 709fcc875f13..61e52e61280a 100644 --- a/sys/gnu/isdn/iitel.c +++ b/sys/gnu/isdn/iitel.c @@ -1,6 +1,6 @@ -static char _itelid[] = "@(#)$Id: iitel.c,v 1.10 1995/12/08 23:19:42 phk Exp $"; +static char _itelid[] = "@(#)$Id: iitel.c,v 1.11 1995/12/17 21:17:44 phk Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.10 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.11 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -67,7 +67,6 @@ int itelattach(int ap) { struct itel_data *itel; - char name[32]; if(next_if >= NITEL) return(-1); @@ -76,9 +75,9 @@ itelattach(int ap) itel->state= 0; applnr[next_if]= ap; #ifdef DEVFS - sprintf(name,"itel%d",next_if); - itel->devfs_token = devfs_add_devsw("/isdn",name,&itel_cdevsw,next_if, - DV_CHR, 0, 0, 0600); + itel->devfs_token = + devfs_add_devswf(&itel_cdevsw, next_if, DV_CHR, 0, 0, + 0600, "isdn/itel%d", next_if); #endif return(next_if++); } diff --git a/sys/gnu/isdn/iitty.c b/sys/gnu/isdn/iitty.c index ad5329cc5f86..491b02298c2a 100644 --- a/sys/gnu/isdn/iitty.c +++ b/sys/gnu/isdn/iitty.c @@ -1,6 +1,6 @@ -static char _ittyid[] = "@(#)$Id: iitty.c,v 1.18 1995/12/10 15:54:13 bde Exp $"; +static char _ittyid[] = "@(#)$Id: iitty.c,v 1.19 1995/12/17 21:17:47 phk Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.18 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.19 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -66,18 +66,17 @@ static void *devfs_token_out[NITY]; int ityattach(int ap) { - char name[32]; if(next_if >= NITY) return(-1); applnr[next_if]= ap; #ifdef DEVFS - sprintf(name,"ity%d",next_if); - devfs_token[next_if] = devfs_add_devsw("/isdn",name, - &ity_cdevsw,next_if, DV_CHR, 0, 0, 0600); - sprintf(name,"Oity%d",next_if); /* XXX find out real name */ - devfs_token[next_if] = devfs_add_devsw("/isdn",name, - &ity_cdevsw,(next_if | 0x80), DV_CHR, 0, 0, 0600); + devfs_token[next_if] = + devfs_add_devswf(&ity_cdevsw, next_if, DV_CHR, 0, 0, + 0600, "isdn/ity%d", next_if); + devfs_token[next_if] = + devfs_add_devswf(&ity_cdevsw,(next_if | 0x80), DV_CHR, 0, 0, + 0600, "isdn/Oity%d", next_if); #endif return(next_if++); } diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c index 855a6706a419..144894970bbe 100644 --- a/sys/i386/apm/apm.c +++ b/sys/i386/apm/apm.c @@ -13,7 +13,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.35 1996/03/19 16:48:38 nate Exp $ + * $Id: apm.c,v 1.36 1996/03/19 16:56:56 nate Exp $ */ #include "apm.h" @@ -62,7 +62,9 @@ struct apm_softc { u_int intversion; struct apmhook sc_suspend; struct apmhook sc_resume; +#ifdef DEVFS void *sc_devfs_token; +#endif }; static struct kern_devconf kdc_apm = { @@ -809,8 +811,8 @@ apmattach(struct isa_device *dvp) sc->initialized = 1; #ifdef DEVFS - sc->sc_devfs_token = devfs_add_devsw( - "/", "apm", &apm_cdevsw, 0, DV_CHR, 0, 0, 0600); + sc->sc_devfs_token = + devfs_add_devswf(&apm_cdevsw, 0, DV_CHR, 0, 0, 0600, "apm"); #endif return 0; } diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 855a6706a419..144894970bbe 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -13,7 +13,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.35 1996/03/19 16:48:38 nate Exp $ + * $Id: apm.c,v 1.36 1996/03/19 16:56:56 nate Exp $ */ #include "apm.h" @@ -62,7 +62,9 @@ struct apm_softc { u_int intversion; struct apmhook sc_suspend; struct apmhook sc_resume; +#ifdef DEVFS void *sc_devfs_token; +#endif }; static struct kern_devconf kdc_apm = { @@ -809,8 +811,8 @@ apmattach(struct isa_device *dvp) sc->initialized = 1; #ifdef DEVFS - sc->sc_devfs_token = devfs_add_devsw( - "/", "apm", &apm_cdevsw, 0, DV_CHR, 0, 0, 0600); + sc->sc_devfs_token = + devfs_add_devswf(&apm_cdevsw, 0, DV_CHR, 0, 0, 0600, "apm"); #endif return 0; } diff --git a/sys/i386/i386/cons.c b/sys/i386/i386/cons.c index 9ab77a155f85..289e5c87ea46 100644 --- a/sys/i386/i386/cons.c +++ b/sys/i386/i386/cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.42 1996/03/27 18:55:19 bde Exp $ + * $Id: cons.c,v 1.43 1996/03/27 19:04:54 bde Exp $ */ #include @@ -327,15 +327,9 @@ cn_drvinit(void *unused) cdevsw_add(&dev,&cn_cdevsw,NULL); cn_devsw_installed = 1; #ifdef DEVFS - cn_devfs_token = devfs_add_devsw( - "/", - "console", - &cn_cdevsw, - 0, - DV_CHR, - 0, - 0, - 0640); + cn_devfs_token = + devfs_add_devswf(&cn_cdevsw, 0, DV_CHR, 0, 0, + 0640, "console"); #endif } } diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c index 1ddb8c98b91c..a6eca2955f01 100644 --- a/sys/i386/isa/asc.c +++ b/sys/i386/isa/asc.c @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * $Id: asc.c,v 1.15 1996/01/13 20:43:08 bde Exp $ + * $Id: asc.c,v 1.16 1996/01/27 00:53:55 bde Exp $ */ #include "asc.h" @@ -438,9 +438,6 @@ ascattach(struct isa_device *isdp) { int unit = isdp->id_unit; struct asc_unit *scu = unittab + unit; -#ifdef DEVFS - char name[32]; -#endif scu->flags |= FLAG_DEBUG; printf("asc%d: [GI1904/Trust Ami-Scan Grey, type S2]\n", unit); @@ -484,22 +481,19 @@ ascattach(struct isa_device *isdp) #ifdef DEVFS #define ASC_UID 0 #define ASC_GID 13 - sprintf(name,"asc%d",unit); -/* path name devsw minor type uid gid perm*/ - scu->devfs_asc = devfs_add_devsw("/", name, &asc_cdevsw, unit<<6, - DV_CHR, ASC_UID, ASC_GID, 0666); - sprintf(name,"asc%dp",unit); - scu->devfs_ascp = devfs_add_devsw("/", name, &asc_cdevsw, - ((unit<<6) + FRMT_PBM), - DV_CHR, ASC_UID, ASC_GID, 0666); - sprintf(name,"asc%dd",unit); - scu->devfs_ascd = devfs_add_devsw("/", name, &asc_cdevsw, - ((unit<<6) + DBUG_MASK), - DV_CHR, ASC_UID, ASC_GID, 0666); - sprintf(name,"asc%dpd",unit); - scu->devfs_ascpd = devfs_add_devsw("/", name, &asc_cdevsw, - ((unit<<6) + DBUG_MASK + FRMT_PBM), - DV_CHR, ASC_UID, ASC_GID, 0666); + scu->devfs_asc = + devfs_add_devswf(&asc_cdevsw, unit<<6, DV_CHR, ASC_UID, + ASC_GID, 0666, "asc%d", unit); + scu->devfs_ascp = + devfs_add_devswf(&asc_cdevsw, ((unit<<6) + FRMT_PBM), DV_CHR, + ASC_UID, ASC_GID, 0666, "asc%dp", unit); + scu->devfs_ascd = + devfs_add_devswf(&asc_cdevsw, ((unit<<6) + DBUG_MASK), DV_CHR, + ASC_UID, ASC_GID, 0666, "asc%dd", unit); + scu->devfs_ascpd = + devfs_add_devswf(&asc_cdevsw, ((unit<<6) + DBUG_MASK+FRMT_PBM), + DV_CHR, ASC_UID, ASC_GID, 0666, "asc%dpd", + unit); #endif /*DEVFS*/ return ATTACH_SUCCESS; } diff --git a/sys/i386/isa/b004.c b/sys/i386/isa/b004.c index ff2a3f20e45f..5b56a344167e 100644 --- a/sys/i386/isa/b004.c +++ b/sys/i386/isa/b004.c @@ -558,7 +558,6 @@ bquattach(struct isa_device *idp) { int unit = idp->id_unit; struct b004_struct *bp; - char name[32]; int i; kdc_bqu[unit].kdc_state = DC_IDLE; @@ -572,22 +571,18 @@ bquattach(struct isa_device *idp) #ifdef NOTYET /* if (we've done all the ports found) break; */ #endif - sprintf(name,"ttyba%d" ,i); - bp->devfs_token[i][0]=devfs_add_devsw( - "/", name, &bqu_cdevsw, i, DV_CHR, - BQU_UID, BQU_GID, BQU_PERM); - sprintf(name,"ttybd%d" ,i); - bp->devfs_token[i][0]=devfs_add_devsw( - "/", name, &bqu_cdevsw, i+64, DV_CHR, - BQU_UID, BQU_GID, BQU_PERM); - sprintf(name,"ttybc%d" ,i); - bp->devfs_token[i][0]=devfs_add_devsw( - "/", name, &bqu_cdevsw, i+128, DV_CHR, - BQU_UID, BQU_GID, BQU_PERM); - sprintf(name,"ttybd%d" ,i); - bp->devfs_token[i][0]=devfs_add_devsw( - "/", name, &bqu_cdevsw, i+192, DV_CHR, - BQU_UID, BQU_GID, BQU_PERM); + bp->devfs_token[i][0]= + devfs_add_devswf(&bqu_cdevsw, i, DV_CHR, BQU_UID, + BQU_GID, BQU_PERM, "ttyba%d", i); + bp->devfs_token[i][0]= + devfs_add_devswf(&bqu_cdevsw, i+64, DV_CHR, BQU_UID, + BQU_GID, BQU_PERM, "ttybb%d", i); + bp->devfs_token[i][0]= + devfs_add_devswf(&bqu_cdevsw, i+128, DV_CHR, BQU_UID, + BQU_GID, BQU_PERM, "ttybc%d", i); + bp->devfs_token[i][0]= + devfs_add_devswf(&bqu_cdevsw, i+192, DV_CHR, BQU_UID, + BQU_GID, BQU_PERM, "ttybd%d", unit); } #endif return 1; diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c index 4a80d1d5af4e..b56a1f81e755 100644 --- a/sys/i386/isa/ctx.c +++ b/sys/i386/isa/ctx.c @@ -8,7 +8,7 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: ctx.c,v 1.15 1995/12/15 00:29:28 bde Exp $ + * $Id: ctx.c,v 1.16 1995/12/15 00:53:55 bde Exp $ */ /* @@ -214,7 +214,6 @@ static int ctxattach(struct isa_device * devp) { struct ctx_soft_registers *sr; - char name[32]; sr = &(ctx_sr[devp->id_unit]); sr->cp0 = 0; /* zero out the shadow registers */ @@ -226,9 +225,9 @@ ctxattach(struct isa_device * devp) kdc_ctx[devp->id_unit].kdc_state = DC_IDLE; return (1); #ifdef DEVFS - sprintf(name,"ctx%d",devp->id_unit); - sr->devfs_token = devfs_add_devsw( "/", name, &ctx_cdevsw, 0, - DV_CHR, 0, 0, 0600); + sr->devfs_token = + devfs_add_devswf(&ctx_cdevsw, 0, DV_CHR, 0, 0, 0600, + "ctx%d", devp->id_unit); #endif /* DEVFS */ } diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index f62c6baadf84..3c666a660c71 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.79 1996/01/27 04:17:50 bde Exp $ + * $Id: fd.c,v 1.80 1996/02/25 21:01:31 bde Exp $ * */ @@ -767,13 +767,14 @@ fdattach(struct isa_device *dev) kdc_fd[fdu].kdc_state = DC_IDLE; #ifdef DEVFS mynor = 8 * fdu; - fd->bdev = devfs_add_devsw("/", name + 1, &fd_bdevsw, mynor, - DV_BLK, 0, 0, 0640); - fd->cdev = devfs_add_devsw("/", name, &fd_cdevsw, mynor, - DV_CHR, 0, 0, 0640); - sprintf(name, "rfd%d", fdu); - dev_link("/", name + 1, fd->bdev); - dev_link("/", name, fd->cdev); + fd->bdev = + devfs_add_devswf(&fd_bdevsw, mynor, DV_BLK, 0, 0, + 0640, name + 1); + fd->cdev = + devfs_add_devswf(&fd_cdevsw, mynor, + DV_CHR, 0, 0, 0640, name); + dev_link(fd->bdev, "fd%d", fdu); + dev_link(fd->cdev, "rfd%d", fdu); #endif /* DEVFS */ if (dk_ndrive < DK_NDRIVE) { sprintf(dk_names[dk_ndrive], "fd%d", fdu); diff --git a/sys/i386/isa/gpib.c b/sys/i386/isa/gpib.c index 2b4f1acf265c..39bc76e58233 100644 --- a/sys/i386/isa/gpib.c +++ b/sys/i386/isa/gpib.c @@ -145,8 +145,8 @@ gpattach(isdp) sc->sc_flags |=ATTACHED; #ifdef DEVFS - sc->devfs_token = devfs_add_devsw( "/", "gp", &gp_cdevsw, 0, - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&gp_cdevsw, 0, DV_CHR, 0, 0, 0600, "gp"); #endif return (1); } diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c index 29f812a1f430..3478f8487687 100644 --- a/sys/i386/isa/gsc.c +++ b/sys/i386/isa/gsc.c @@ -522,22 +522,19 @@ gscattach(struct isa_device *isdp) #ifdef DEVFS #define GSC_UID 0 #define GSC_GID 13 - sprintf(name,"gsc%d",unit); -/* path name devsw minor type uid gid perm*/ - scu->devfs_gsc = devfs_add_devsw("/", name, &gsc_cdevsw, unit<<6, - DV_CHR, GSC_UID, GSC_GID, 0666); - sprintf(name,"gsc%dp",unit); - scu->devfs_gscp = devfs_add_devsw("/", name, &gsc_cdevsw, - ((unit<<6) + FRMT_PBM), - DV_CHR, GSC_UID, GSC_GID, 0666); - sprintf(name,"gsc%dd",unit); - scu->devfs_gscd = devfs_add_devsw("/", name, &gsc_cdevsw, - ((unit<<6) + DBUG_MASK), - DV_CHR, GSC_UID, GSC_GID, 0666); - sprintf(name,"gsc%dpd",unit); - scu->devfs_gscpd = devfs_add_devsw("/", name, &gsc_cdevsw, - ((unit<<6) + DBUG_MASK + FRMT_PBM), - DV_CHR, GSC_UID, GSC_GID, 0666); + scu->devfs_gsc = + devfs_add_devswf(&gsc_cdevsw, unit<<6, DV_CHR, GSC_UID, GSC_GID, + 0666, "gsc%d", unit); + scu->devfs_gscp = + devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + FRMT_PBM), DV_CHR, + GSC_UID, GSC_GID, 0666, "gsc%dp", unit); + scu->devfs_gscd = + devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + DBUG_MASK), DV_CHR, + GSC_UID, GSC_GID, 0666, "gsc%dd", unit); + scu->devfs_gscpd = + devfs_add_devswf(&gsc_cdevsw, ((unit<<6) + DBUG_MASK+FRMT_PBM), + DV_CHR, GSC_UID, GSC_GID, 0666, "gsc%dpd", + unit); #endif /*DEVFS*/ return ATTACH_SUCCESS; diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c index bdbdef1efd87..c1114c79dd56 100644 --- a/sys/i386/isa/if_cx.c +++ b/sys/i386/isa/if_cx.c @@ -218,6 +218,11 @@ cxprobe (struct isa_device *id) /* * The adapter is present, initialize the driver structures. */ + +#ifdef DEVFS +static void *cx_devfs_token; +#endif + static int cxattach (struct isa_device *id) { @@ -302,12 +307,8 @@ cxattach (struct isa_device *id) dev_attach (&kdc_cx[unit]); printf ("cx%d: \n", unit, b->name); #ifdef DEVFS - { - void *x; - x=devfs_add_devsw( -/* path name devsw minor type uid gid perm*/ - "/", "cx", &cx_cdevsw, 0, DV_CHR, 0, 0, 0600); - } + cx_devfs_token = + devfs_add_devswf(&cx_cdevsw, 0, DV_CHR, 0, 0, 0600, "cx"); #endif return (1); } diff --git a/sys/i386/isa/joy.c b/sys/i386/isa/joy.c index ffb615d8a44a..350d7846d840 100644 --- a/sys/i386/isa/joy.c +++ b/sys/i386/isa/joy.c @@ -115,16 +115,14 @@ static int joyattach (struct isa_device *dev) { int unit = dev->id_unit; - char name[32]; joy[unit].port = dev->id_iobase; joy[unit].timeout[0] = joy[unit].timeout[1] = 0; printf("joy%d: joystick\n", unit); #ifdef DEVFS - sprintf(name, "joy%d", unit); - joy[dev->id_unit].devfs_token = devfs_add_devsw( "/", "joy", - &joy_cdevsw, 0, - DV_CHR, 0, 0, 0600); + joy[dev->id_unit].devfs_token = + devfs_add_devswf(&joy_cdevsw, 0, DV_CHR, 0, 0, + 0600, "joy%d", unit); #endif return 1; } diff --git a/sys/i386/isa/labpc.c b/sys/i386/isa/labpc.c index 7185088ff916..2e139d986808 100644 --- a/sys/i386/isa/labpc.c +++ b/sys/i386/isa/labpc.c @@ -507,7 +507,6 @@ static int labpcattach(struct isa_device *dev) { struct ctlr *ctlr = labpcs[dev->id_unit]; - char name[32]; ctlr->sample_us = (1000000.0 / (double)LABPC_DEFAULT_HERZ) + .50; reset(ctlr); @@ -520,11 +519,11 @@ labpcattach(struct isa_device *dev) loutb(DCR(ctlr), ctlr->dcr_val); #ifdef DEVFS - sprintf(name, "labpc%d",dev->id_unit); - /* path name devsw minor */ - ctlr->devfs_token = devfs_add_devsw( "/", name, &labpc_cdevsw, 0, - /* what UID GID PERM */ - DV_CHR, 0, 0, 0600); + ctlr->devfs_token = + devfs_add_devswf(&labpc_cdevsw, 0, DV_CHR, + /* what UID GID PERM */ + 0, 0, 0600, + "labpc%d", dev->id_unit); #endif return 1; } diff --git a/sys/i386/isa/lpt.c b/sys/i386/isa/lpt.c index ab9744c31b8d..867afec783e7 100644 --- a/sys/i386/isa/lpt.c +++ b/sys/i386/isa/lpt.c @@ -46,7 +46,7 @@ * SUCH DAMAGE. * * from: unknown origin, 386BSD 0.1 - * $Id: lpt.c,v 1.49 1996/02/06 18:50:52 wollman Exp $ + * $Id: lpt.c,v 1.50 1996/03/04 15:58:25 phk Exp $ */ /* @@ -453,7 +453,6 @@ lptattach(struct isa_device *isdp) { struct lpt_softc *sc; int unit; - char name[32]; unit = isdp->id_unit; sc = lpt_sc + unit; @@ -479,10 +478,9 @@ lptattach(struct isa_device *isdp) #ifdef DEVFS /* XXX */ /* what to do about the flags in the minor number? */ - sprintf(name,"lpt%d",unit); - /* path name devsw minor type uid gid perm*/ - sc->devfs_token = devfs_add_devsw( "/", name, &lpt_cdevsw, unit, - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&lpt_cdevsw, unit, DV_CHR, 0, 0, 0600, + "lpt%d", unit); #endif return (1); } diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c index 8c43fd7d2c7e..da32789d94b5 100644 --- a/sys/i386/isa/matcd/matcd.c +++ b/sys/i386/isa/matcd/matcd.c @@ -337,7 +337,7 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95"; static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV"; /* The proceeding strings may not be changed*/ -/* $Id: matcd.c,v 1.13 1995/12/10 13:40:42 phk Exp $ */ +/* $Id: matcd.c,v 1.14 1995/12/10 19:52:36 bde Exp $ */ /*--------------------------------------------------------------------------- Include declarations @@ -1460,9 +1460,6 @@ matcd_attach(struct isa_device *dev) unsigned char data[12]; struct matcd_data *cd; int port = dev->id_iobase; /*Take port ID selected in probe()*/ -#ifdef DEVFS - char name[32]; -#endif #ifdef DIAGPORT DIAGOUT(DIAGPORT,0x70); /*Show where we are*/ @@ -1516,25 +1513,23 @@ matcd_attach(struct isa_device *dev) #ifdef DEVFS #define MATCD_UID 0 #define MATCD_GID 13 - sprintf(name, "rmatcd%da",i); - cd->ra_devfs_token = devfs_add_devsw( - "/", name, &matcd_cdevsw, 0, - DV_CHR, MATCD_UID, MATCD_GID, 0600); - - sprintf(name, "rmatcd%dc",i); - cd->rc_devfs_token = devfs_add_devsw( - "/", name, &matcd_cdevsw, RAW_PART, - DV_CHR, MATCD_UID, MATCD_GID, 0600); - - sprintf(name, "matcd%da",i); - cd->a_devfs_token = devfs_add_devsw( - "/", name, &matcd_bdevsw, 0, - DV_BLK, MATCD_UID, MATCD_GID, 0600); + cd->ra_devfs_token = + devfs_add_devswf(&matcd_cdevsw, 0, DV_CHR, + MATCD_UID, MATCD_GID, 0600, + "rmatcd%da", i); + cd->rc_devfs_token = + devfs_add_devswf(&matcd_cdevsw, RAW_PART, + DV_CHR, MATCD_UID, MATCD_GID, + 0600, "rmatcd%dc", i); + cd->a_devfs_token = + devfs_add_devswf(&matcd_bdevsw, 0, DV_BLK, + MATCD_UID, MATCD_GID, 0600, + "matcd%da", i); - sprintf(name, "matcd%dc",i); - cd->c_devfs_token = devfs_add_devsw( - "/", name, &matcd_bdevsw, RAW_PART, - DV_BLK, MATCD_UID, MATCD_GID, 0600); + cd->c_devfs_token = + devfs_add_devswf(&matcd_bdevsw, RAW_PART, + DV_BLK, MATCD_UID, MATCD_GID, + 0600, "matcd%dc", i); #endif } } diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c index 645a7eb95a45..a364c041dd4d 100644 --- a/sys/i386/isa/mcd.c +++ b/sys/i386/isa/mcd.c @@ -40,7 +40,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mcd.c,v 1.73 1996/02/27 19:08:39 ache Exp $ + * $Id: mcd.c,v 1.74 1996/03/17 13:33:42 ache Exp $ */ static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore"; @@ -275,7 +275,6 @@ int mcd_attach(struct isa_device *dev) { int unit = dev->id_unit; struct mcd_data *cd = mcd_data + unit; - char name[32]; cd->iobase = dev->id_iobase; cd->flags |= MCDINIT; @@ -291,25 +290,18 @@ int mcd_attach(struct isa_device *dev) #ifdef DEVFS #define MCD_UID 0 #define MCD_GID 13 - sprintf(name, "rmcd%da",unit); - cd->ra_devfs_token = devfs_add_devsw( - "/", name, &mcd_cdevsw, (unit * 8 ) + 0, - DV_CHR, MCD_UID, MCD_GID, 0600); - - sprintf(name, "rmcd%dc",unit); - cd->rc_devfs_token = devfs_add_devsw( - "/", name, &mcd_cdevsw, (unit * 8 ) + RAW_PART, - DV_CHR, MCD_UID, MCD_GID, 0600); - - sprintf(name, "mcd%da",unit); - cd->a_devfs_token = devfs_add_devsw( - "/", name, &mcd_bdevsw, (unit * 8 ) + 0, - DV_BLK, MCD_UID, MCD_GID, 0600); - - sprintf(name, "mcd%dc",unit); - cd->c_devfs_token = devfs_add_devsw( - "/", name, &mcd_bdevsw, (unit * 8 ) + RAW_PART, - DV_BLK, MCD_UID, MCD_GID, 0600); + cd->ra_devfs_token = + devfs_add_devswf(&mcd_cdevsw, (unit * 8 ) + 0, DV_CHR, MCD_UID, + MCD_GID, 0600, "rmcd%da", unit); + cd->rc_devfs_token = + devfs_add_devswf(&mcd_cdevsw, (unit * 8 ) + RAW_PART, DV_CHR, + MCD_UID, MCD_GID, 0600, "rmcd%dc", unit); + cd->a_devfs_token = + devfs_add_devswf(&mcd_bdevsw, (unit * 8 ) + 0, DV_BLK, MCD_UID, + MCD_GID, 0600, "mcd%da", unit); + cd->c_devfs_token = + devfs_add_devswf(&mcd_bdevsw, (unit * 8 ) + RAW_PART, DV_BLK, + MCD_UID, MCD_GID, 0600, "mcd%dc", unit); #endif return 1; } diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c index 01df8501164a..efa306500403 100644 --- a/sys/i386/isa/mse.c +++ b/sys/i386/isa/mse.c @@ -11,7 +11,7 @@ * this software for any purpose. It is provided "as is" * without express or implied warranty. * - * $Id: mse.c,v 1.23 1995/12/15 00:29:30 bde Exp $ + * $Id: mse.c,v 1.24 1995/12/15 00:54:25 bde Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -257,23 +257,18 @@ int mseattach(idp) struct isa_device *idp; { - char name[32]; int unit = idp->id_unit; struct mse_softc *sc = &mse_sc[unit]; sc->sc_port = idp->id_iobase; kdc_mse[unit].kdc_state = DC_IDLE; #ifdef DEVFS - sprintf(name,"mse%d", unit); - /* path name devsw minor */ - sc->devfs_token = devfs_add_devsw( "/", name, &mse_cdevsw, unit << 1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0600); - sprintf(name,"nmse%d", unit); - /* path name devsw minor */ - sc->n_devfs_token = devfs_add_devsw("/", name, &mse_cdevsw, (unit<<1)+1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&mse_cdevsw, unit << 1, DV_CHR, 0, 0, + 0600, "mse%d", unit); + sc->n_devfs_token = + devfs_add_devswf(&mse_cdevsw, (unit<<1)+1, DV_CHR,0, 0, + 0600, "nmse%d", unit); #endif return (1); } diff --git a/sys/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c index fda6a24ff974..5ede8f0d7474 100644 --- a/sys/i386/isa/pcaudio.c +++ b/sys/i386/isa/pcaudio.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcaudio.c,v 1.25 1995/12/15 00:54:29 bde Exp $ + * $Id: pcaudio.c,v 1.26 1995/12/22 15:27:48 bde Exp $ */ #include "pca.h" @@ -81,8 +81,11 @@ static char buffer1[BUF_SIZE]; static char buffer2[BUF_SIZE]; static char volume_table[256]; +#ifdef DEVFS static void *pca_devfs_token; static void *pcac_devfs_token; +#endif + static int pca_sleep = 0; static int pca_initialized = 0; @@ -271,11 +274,11 @@ pcaattach(struct isa_device *dvp) pca_init(); pca_registerdev(dvp); #ifdef DEVFS - /* path, name, devsw, minor, type, uid, gid, perm */ - pca_devfs_token = devfs_add_devsw("/", "pcaudio", &pca_cdevsw, 0, - DV_CHR, 0, 0, 0600); - pcac_devfs_token = devfs_add_devsw("/", "pcaudioctl", &pca_cdevsw, 128, - DV_CHR, 0, 0, 0600); + pca_devfs_token = + devfs_add_devswf(&pca_cdevsw, 0, DV_CHR, 0, 0, 0600, "pcaudio"); + pcac_devfs_token = + devfs_add_devswf(&pca_cdevsw, 128, DV_CHR, 0, 0, 0600, + "pcaudioctl"); #endif /*DEVFS*/ return 1; diff --git a/sys/i386/isa/psm.c b/sys/i386/isa/psm.c index 1febc6cd546d..8783459b6f45 100644 --- a/sys/i386/isa/psm.c +++ b/sys/i386/isa/psm.c @@ -224,7 +224,6 @@ psmopen(dev_t dev, int flag, int fmt, struct proc *p) int unit = PSMUNIT(dev); struct psm_softc *sc; int ioport; - char name[32]; /* Validate unit number */ @@ -269,16 +268,12 @@ psmopen(dev_t dev, int flag, int fmt, struct proc *p) /* Successful open */ #ifdef DEVFS - sprintf(name,"psm%d", unit); - /* path name devsw minor */ - sc->devfs_token = devfs_add_devsw( "/", name, &psm_cdevsw, unit << 1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0666); - sprintf(name,"npsm%d", unit); - /* path name devsw minor */ - sc->n_devfs_token = devfs_add_devsw("/", name, &psm_cdevsw, (unit<<1)+1, - /*type uid gid perm*/ - DV_CHR, 0, 0, 0666); + sc->devfs_token = + devfs_add_devswf(&psm_cdevsw, unit << 1, DV_CHR, 0, 0, 0666, + "psm%d", unit); + sc->n_devfs_token = + devfs_add_devswf(&psm_cdevsw, (unit<<1)+1, DV_CHR,0, 0, 0666, + "npsm%d", unit); #endif return(0); diff --git a/sys/i386/isa/qcam.c b/sys/i386/isa/qcam.c index dd360f97b7ad..e0b076d63c64 100644 --- a/sys/i386/isa/qcam.c +++ b/sys/i386/isa/qcam.c @@ -176,12 +176,9 @@ qcam_attach (struct isa_device *devp) qs->unit, qs->flags & QC_BIDIR_HW ? "bi" : "uni"); #ifdef DEVFS -{ - char name[32]; - sprintf(name,"qcam%d", qs->unit); - qs->devfs_token = devfs_add_devsw("/", name, &qcam_cdevsw, qs->unit, - DV_CHR, 0, 0, 0600); -} + qs->devfs_token = + devfs_add_devswf(&qcam_cdevsw, qs->unit, DV_CHR, 0, 0, 0600, + "qcam%d", qs->unit); #endif return 1; } diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c index 7844e4de8566..d05b42359729 100644 --- a/sys/i386/isa/rc.c +++ b/sys/i386/isa/rc.c @@ -263,7 +263,6 @@ rcattach(dvp) struct rc_chans *rc = &rc_chans[dvp->id_unit * CD180_NCHAN]; static int rc_wakeup_started = 0; struct tty *tp; - char name[32]; /* Thorooughly test the device */ if (rcb->rcb_probed != RC_PROBED) @@ -296,10 +295,11 @@ rcattach(dvp) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; #ifdef DEVFS /* FIX THIS to reflect real devices */ - sprintf(name,"rc%d.%d",dvp->id_unit,chan); - rc->devfs_token = devfs_add_devsw( "/", name, - &rc_cdevsw,(dvp->id_unit * CD180_NCHAN) + chan , - DV_CHR, 0, 0, 0600); + rc->devfs_token = + devfs_add_devswf(&rc_cdevsw, + (dvp->id_unit * CD180_NCHAN) + chan, + DV_CHR, 0, 0, 0600, "rc%d.%d", + dvp->id_unit, chan); #endif } rcb->rcb_probed = RC_ATTACHED; diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c index b313491741d7..e8a6982d7f93 100644 --- a/sys/i386/isa/scd.c +++ b/sys/i386/isa/scd.c @@ -41,7 +41,7 @@ */ -/* $Id: scd.c,v 1.16 1995/12/10 20:10:23 bde Exp $ */ +/* $Id: scd.c,v 1.17 1996/01/15 10:28:32 phk Exp $ */ /* Please send any comments to micke@dynas.se */ @@ -232,7 +232,6 @@ int scd_attach(struct isa_device *dev) { int unit = dev->id_unit; struct scd_data *cd = scd_data + unit; - char name[32]; cd->iobase = dev->id_iobase; /* Already set by probe, but ... */ @@ -249,25 +248,18 @@ int scd_attach(struct isa_device *dev) #ifdef DEVFS #define SCD_UID 0 #define SCD_GID 13 - sprintf(name, "rscd%da",unit); - cd->ra_devfs_token = devfs_add_devsw( - "/", name, &scd_cdevsw, (unit * 8 ) + 0, - DV_CHR, SCD_UID, SCD_GID, 0600); - - sprintf(name, "rscd%dc",unit); - cd->rc_devfs_token = devfs_add_devsw( - "/", name, &scd_cdevsw, (unit * 8 ) + RAW_PART, - DV_CHR, SCD_UID, SCD_GID, 0600); - - sprintf(name, "scd%da",unit); - cd->a_devfs_token = devfs_add_devsw( - "/", name, &scd_bdevsw, (unit * 8 ) + 0, - DV_BLK, SCD_UID, SCD_GID, 0600); - - sprintf(name, "scd%dc",unit); - cd->c_devfs_token = devfs_add_devsw( - "/", name, &scd_bdevsw, (unit * 8 ) + RAW_PART, - DV_BLK, SCD_UID, SCD_GID, 0600); + cd->ra_devfs_token = + devfs_add_devswf(&scd_cdevsw, (unit * 8 ) + 0, DV_CHR, SCD_UID, + SCD_GID, 0600, "rscd%da", unit); + cd->rc_devfs_token = + devfs_add_devswf(&scd_cdevsw, (unit * 8 ) + RAW_PART, DV_CHR, + SCD_UID, SCD_GID, 0600, "rscd%dc", unit); + cd->a_devfs_token = + devfs_add_devswf(&scd_bdevsw, (unit * 8 ) + 0, DV_BLK, SCD_UID, + SCD_GID, 0600, "scd%da", unit); + cd->c_devfs_token = + devfs_add_devswf(&scd_bdevsw, (unit * 8 ) + RAW_PART, DV_BLK, + SCD_UID, SCD_GID, 0600, "scd%dc", unit); #endif return 1; } diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c index 8be544f88279..faef542ea8ea 100644 --- a/sys/i386/isa/si.c +++ b/sys/i386/isa/si.c @@ -30,7 +30,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHORS BE LIABLE. * - * $Id: si.c,v 1.35 1996/01/16 18:13:18 phk Exp $ + * $Id: si.c,v 1.36 1996/01/25 07:21:33 phk Exp $ */ #ifndef lint @@ -710,9 +710,9 @@ siattach(id) &si_cdevsw, x + 0x20000, DV_CHR, 0, 0, 0600, "ttylA%02d", y); } - sc->control_token = devfs_add_devsw("/", "si_control", - &si_cdevsw, 0x40000, - DV_CHR, 0, 0, 0600); + sc->control_token = + devfs_add_devswf(&si_cdevsw, 0x40000, DV_CHR, 0, 0, 0600, + "si_control"); #endif return (1); } diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c index aec50936db90..be46e0ebb2b2 100644 --- a/sys/i386/isa/spigot.c +++ b/sys/i386/isa/spigot.c @@ -168,7 +168,6 @@ struct spigot_softc *ss=(struct spigot_softc *)&spigot_softc[devp->id_unit]; static int spigot_attach(struct isa_device *devp) { - char name[32]; int unit; struct spigot_softc *ss= &spigot_softc[unit = devp->id_unit]; @@ -177,11 +176,9 @@ spigot_attach(struct isa_device *devp) ss->maddr = kvtop(devp->id_maddr); ss->irq = devp->id_irq; #ifdef DEVFS - sprintf(name,"spigot%d",unit); -/* path name devsw minor type uid gid perm*/ - ss->devfs_token = devfs_add_devsw( "/", name, - &spigot_cdevsw, unit, - DV_CHR, 0, 0, 0644); + ss->devfs_token = + devfs_add_devswf(&spigot_cdevsw, unit, DV_CHR, 0, 0, 0644, + "spigot%d", unit); #endif return 1; diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c index 0120189528b0..ace3a30e252a 100644 --- a/sys/i386/isa/tw.c +++ b/sys/i386/isa/tw.c @@ -360,7 +360,6 @@ twattach(idp) struct isa_device *idp; { struct tw_sc *sc; - char name[32]; int unit; sc = &tw_sc[unit = idp->id_unit]; @@ -368,10 +367,9 @@ twattach(idp) sc->sc_state = 0; #ifdef DEVFS -/* path name devsw minor type uid gid perm*/ - sprintf(name,"tw%d", unit); - sc->devfs_token = devfs_add_devsw( "/", name, &tw_cdevsw, unit, - DV_CHR, 0, 0, 0600); + sc->devfs_token = + devfs_add_devswf(&tw_cdevsw, unit, DV_CHR, 0, 0, + 0600, "tw%d", unit); #endif return (1); diff --git a/sys/i386/isa/wcd.c b/sys/i386/isa/wcd.c index 5b8efc7c29fc..b95a3a039888 100644 --- a/sys/i386/isa/wcd.c +++ b/sys/i386/isa/wcd.c @@ -290,7 +290,6 @@ wcdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug, struct wcd *t; struct atapires result; int lun; - char name[32]; if (wcdnlun >= NUNIT) { printf ("wcd: too many units\n"); @@ -357,25 +356,18 @@ wcdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug, #ifdef DEVFS #define WDC_UID 0 #define WDC_GID 13 - sprintf(name, "rwcd%da",lun); - t->ra_devfs_token = devfs_add_devsw( - "/", name, &wcd_cdevsw, (lun * 8), - DV_CHR, WDC_UID, WDC_GID, 0600); - - sprintf(name, "rwcd%dc",lun); - t->rc_devfs_token = devfs_add_devsw( - "/", name, &wcd_cdevsw, (lun * 8) + RAW_PART, - DV_CHR, WDC_UID, WDC_GID, 0600); - - sprintf(name, "wcd%da",lun); - t->a_devfs_token = devfs_add_devsw( - "/", name, &wcd_bdevsw, (lun * 8), - DV_BLK, WDC_UID, WDC_GID, 0600); - - sprintf(name, "wcd%dc",lun); - t->c_devfs_token = devfs_add_devsw( - "/", name, &wcd_bdevsw, (lun * 8) + RAW_PART, - DV_BLK, WDC_UID, WDC_GID, 0600); + t->ra_devfs_token = + devfs_add_devswf(&wcd_cdevsw, (lun * 8), DV_CHR, WDC_UID, + WDC_GID, 0600, "rwcd%da", lun); + t->rc_devfs_token = + devfs_add_devswf(&wcd_cdevsw, (lun * 8) + RAW_PART, DV_CHR, + WDC_UID, WDC_GID, 0600, "rwcd%dc", lun); + t->a_devfs_token = + devfs_add_devswf(&wcd_bdevsw, (lun * 8), DV_BLK, WDC_UID, + WDC_GID, 0600, "wcd%da", lun); + t->c_devfs_token = + devfs_add_devswf(&wcd_bdevsw, (lun * 8) + RAW_PART, DV_BLK, + WDC_UID, WDC_GID, 0600, "wcd%dc", lun); #endif return (1); } diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c index ff7b52b89123..26b3af6cc74c 100644 --- a/sys/i386/isa/wt.c +++ b/sys/i386/isa/wt.c @@ -20,7 +20,7 @@ * the original CMU copyright notice. * * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 - * $Id: wt.c,v 1.29 1996/01/27 02:33:37 bde Exp $ + * $Id: wt.c,v 1.30 1996/02/22 00:31:48 joerg Exp $ * */ @@ -285,7 +285,6 @@ static int wtattach (struct isa_device *id) { wtinfo_t *t = wttab + id->id_unit; - char name[32]; if (t->type == ARCHIVE) { printf ("wt%d: type \n", t->unit); @@ -298,14 +297,12 @@ wtattach (struct isa_device *id) isa_dmainit(t->chan, 1024); #ifdef DEVFS - sprintf(name,"rwt%d",id->id_unit); - t->devfs_token_r = devfs_add_devsw( - "/", name, &wt_cdevsw, id->id_unit, - DV_CHR, 0, 0, 0600); - sprintf(name,"wt%d",id->id_unit); - t->devfs_token = devfs_add_devsw( - "/", name, &wt_bdevsw, id->id_unit, - DV_BLK, 0, 0, 0600); + t->devfs_token_r = + devfs_add_devswf(&wt_cdevsw, id->id_unit, DV_CHR, 0, 0, + 0600, "rwt%d", id->id_unit); + t->devfs_token = + devfs_add_devswf(&wt_bdevsw, id->id_unit, DV_BLK, 0, 0, + 0600, "wt%d", id->id_unit); #endif return (1); } diff --git a/sys/isa/fd.c b/sys/isa/fd.c index f62c6baadf84..3c666a660c71 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.79 1996/01/27 04:17:50 bde Exp $ + * $Id: fd.c,v 1.80 1996/02/25 21:01:31 bde Exp $ * */ @@ -767,13 +767,14 @@ fdattach(struct isa_device *dev) kdc_fd[fdu].kdc_state = DC_IDLE; #ifdef DEVFS mynor = 8 * fdu; - fd->bdev = devfs_add_devsw("/", name + 1, &fd_bdevsw, mynor, - DV_BLK, 0, 0, 0640); - fd->cdev = devfs_add_devsw("/", name, &fd_cdevsw, mynor, - DV_CHR, 0, 0, 0640); - sprintf(name, "rfd%d", fdu); - dev_link("/", name + 1, fd->bdev); - dev_link("/", name, fd->cdev); + fd->bdev = + devfs_add_devswf(&fd_bdevsw, mynor, DV_BLK, 0, 0, + 0640, name + 1); + fd->cdev = + devfs_add_devswf(&fd_cdevsw, mynor, + DV_CHR, 0, 0, 0640, name); + dev_link(fd->bdev, "fd%d", fdu); + dev_link(fd->cdev, "rfd%d", fdu); #endif /* DEVFS */ if (dk_ndrive < DK_NDRIVE) { sprintf(dk_names[dk_ndrive], "fd%d", fdu); diff --git a/sys/isa/joy.c b/sys/isa/joy.c index ffb615d8a44a..350d7846d840 100644 --- a/sys/isa/joy.c +++ b/sys/isa/joy.c @@ -115,16 +115,14 @@ static int joyattach (struct isa_device *dev) { int unit = dev->id_unit; - char name[32]; joy[unit].port = dev->id_iobase; joy[unit].timeout[0] = joy[unit].timeout[1] = 0; printf("joy%d: joystick\n", unit); #ifdef DEVFS - sprintf(name, "joy%d", unit); - joy[dev->id_unit].devfs_token = devfs_add_devsw( "/", "joy", - &joy_cdevsw, 0, - DV_CHR, 0, 0, 0600); + joy[dev->id_unit].devfs_token = + devfs_add_devswf(&joy_cdevsw, 0, DV_CHR, 0, 0, + 0600, "joy%d", unit); #endif return 1; } diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index 9ab77a155f85..289e5c87ea46 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.42 1996/03/27 18:55:19 bde Exp $ + * $Id: cons.c,v 1.43 1996/03/27 19:04:54 bde Exp $ */ #include @@ -327,15 +327,9 @@ cn_drvinit(void *unused) cdevsw_add(&dev,&cn_cdevsw,NULL); cn_devsw_installed = 1; #ifdef DEVFS - cn_devfs_token = devfs_add_devsw( - "/", - "console", - &cn_cdevsw, - 0, - DV_CHR, - 0, - 0, - 0640); + cn_devfs_token = + devfs_add_devswf(&cn_cdevsw, 0, DV_CHR, 0, 0, + 0640, "console"); #endif } }