summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorscrappy <scrappy@FreeBSD.org>1996-03-28 14:29:52 +0000
committerscrappy <scrappy@FreeBSD.org>1996-03-28 14:29:52 +0000
commit415585985cb93ec4bd441c45c7bbd43c2529256d (patch)
treea799d7ab93b91102069e46ed96392e309b7b469f /sys/dev
parentf55298f39fa39052b4a4bb6f1f3a18aa12d6b771 (diff)
downloadFreeBSD-src-415585985cb93ec4bd441c45c7bbd43c2529256d.zip
FreeBSD-src-415585985cb93ec4bd441c45c7bbd43c2529256d.tar.gz
Switched from using devfs_add_sw() to using devfs_add_swf()
Reviewed by: julian@freebsd.org
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/dgb/dgb.c45
-rw-r--r--sys/dev/fdc/fdc.c17
-rw-r--r--sys/dev/joy/joy.c8
-rw-r--r--sys/dev/mcd/mcd.c34
-rw-r--r--sys/dev/mse/mse.c19
-rw-r--r--sys/dev/rc/rc.c10
-rw-r--r--sys/dev/scd/scd.c34
-rw-r--r--sys/dev/si/si.c8
8 files changed, 78 insertions, 97 deletions
diff --git a/sys/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c
index 42810f0..ec67dce 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 @@ load_fep:
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);
-
- 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);
-
- 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);
-
- 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,/*mytical number*/
+ DV_CHR, 0, 0, 0600, "dgb%d.%d", unit,
+ i);
+
+ 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);
+
+ 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);
+
+ 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 f62c6ba..3c666a6 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 ffb615d..350d784 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 645a7eb..a364c04 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 01df850..efa3065 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 7844e4d..d05b423 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 b313491..e8a6982 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 8be544f..faef542 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 @@ mem_fail:
&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);
}
OpenPOWER on IntegriCloud