aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@FreeBSD.org>1996-03-28 14:33:59 +0000
committerMarc G. Fournier <scrappy@FreeBSD.org>1996-03-28 14:33:59 +0000
commitccbc58d3ca3d937861c207f00b4511940d705c4c (patch)
tree76c7cd93029f75249004b135fe2bec1caa30f78d /sys
parent0d5b12e38e4b9e7fe90dc66c091a63dbc8c28da5 (diff)
downloadsrc-ccbc58d3ca3d937861c207f00b4511940d705c4c.tar.gz
src-ccbc58d3ca3d937861c207f00b4511940d705c4c.zip
Using devfs_add_devswf() instead of devfs_add_devsw()
Reviewed by: julian@freebsd.org
Notes
Notes: svn path=/head/; revision=14877
Diffstat (limited to 'sys')
-rw-r--r--sys/net/bpf.c15
-rw-r--r--sys/pci/meteor.c4
-rw-r--r--sys/scsi/cd.c34
-rw-r--r--sys/scsi/sctarg.c11
-rw-r--r--sys/scsi/ssc.c10
-rw-r--r--sys/scsi/st.c5
-rw-r--r--sys/scsi/worm.c14
7 files changed, 43 insertions, 50 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index c22952b423d4..4eebdcc50dde 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -37,7 +37,7 @@
*
* @(#)bpf.c 8.2 (Berkeley) 3/28/94
*
- * $Id: bpf.c,v 1.21 1995/12/14 09:53:10 phk Exp $
+ * $Id: bpf.c,v 1.22 1996/02/06 18:51:04 wollman Exp $
*/
#include "bpfilter.h"
@@ -1300,26 +1300,29 @@ bpfattach(ifp, dlt, hdrlen)
printf("bpf: %s%d attached\n", ifp->if_name, ifp->if_unit);
}
+#ifdef DEVFS
static void *bpf_devfs_token[NBPFILTER];
+#endif
static bpf_devsw_installed = 0;
static void bpf_drvinit(void *unused)
{
dev_t dev;
- int i;
- char name[32];
+#ifdef DEVFS
+ int i;
+#endif
if( ! bpf_devsw_installed ) {
dev = makedev(CDEV_MAJOR, 0);
cdevsw_add(&dev,&bpf_cdevsw, NULL);
bpf_devsw_installed = 1;
#ifdef DEVFS
+
for ( i = 0 ; i < NBPFILTER ; i++ ) {
- sprintf(name,"bpf%d",i);
bpf_devfs_token[i] =
- devfs_add_devsw( "/", name,
- &bpf_cdevsw, i, DV_CHR, 0, 0, 0600);
+ devfs_add_devswf(&bpf_cdevsw, i, DV_CHR, 0, 0,
+ 0600, "bpf%d", i);
}
#endif
}
diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c
index afb37ddd8cc5..dffb3f9fef98 100644
--- a/sys/pci/meteor.c
+++ b/sys/pci/meteor.c
@@ -954,8 +954,8 @@ met_attach(pcici_t tag, int unit)
mtr->flags |= METEOR_INITALIZED | METEOR_AUTOMODE | METEOR_DEV0 |
METEOR_RGB16;
#ifdef DEVFS
- mtr->devfs_token = devfs_add_devsw( "/", "meteor", &meteor_cdevsw, unit,
- DV_CHR, 0, 0, 0644);
+ mtr->devfs_token = devfs_add_devswf(&meteor_cdevsw, unit,
+ DV_CHR, 0, 0, 0644, "meteor");
#endif
}
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 04f5ea336f5a..235ecc38e42f 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: cd.c,v 1.66 1996/02/13 03:46:48 ache Exp $
+ * $Id: cd.c,v 1.67 1996/03/10 07:13:04 gibbs Exp $
*/
#include "opt_bounce.h"
@@ -206,7 +206,6 @@ cdattach(struct scsi_link *sc_link)
u_int32_t unit;
struct cd_parms *dp;
struct scsi_data *cd = sc_link->sd;
- char name[32];
unit = sc_link->dev_unit;
dp = &(cd->params);
@@ -243,25 +242,18 @@ cdattach(struct scsi_link *sc_link)
#ifdef DEVFS
#define CD_UID 0
#define CD_GID 13
- sprintf(name, "rcd%da",unit);
- cd->ra_devfs_token = devfs_add_devsw(
- "/", name, &cd_cdevsw, unit * 8,
- DV_CHR, CD_UID, CD_GID, 0660);
-
- sprintf(name, "rcd%dc",unit);
- cd->rc_devfs_token = devfs_add_devsw(
- "/", name, &cd_cdevsw, (unit * 8 ) + RAW_PART,
- DV_CHR, CD_UID, CD_GID, 0600);
-
- sprintf(name, "cd%da",unit);
- cd->a_devfs_token = devfs_add_devsw(
- "/", name, &cd_bdevsw, (unit * 8 ) + 0,
- DV_BLK, CD_UID, CD_GID, 0660);
-
- sprintf(name, "cd%dc",unit);
- cd->c_devfs_token = devfs_add_devsw(
- "/", name, &cd_bdevsw, (unit * 8 ) + RAW_PART,
- DV_BLK, CD_UID, CD_GID, 0600);
+ cd->ra_devfs_token =
+ devfs_add_devswf(&cd_cdevsw, unit * 8, DV_CHR, CD_UID,
+ CD_GID, 0660, "rcd%da", unit);
+ cd->rc_devfs_token =
+ devfs_add_devswf(&cd_cdevsw, (unit * 8 ) + RAW_PART, DV_CHR,
+ CD_UID, CD_GID, 0600, "rcd%dc", unit);
+ cd->a_devfs_token =
+ devfs_add_devswf(&cd_bdevsw, unit * 8, DV_BLK, CD_UID,
+ CD_GID, 0660, "cd%da", unit);
+ cd->c_devfs_token =
+ devfs_add_devswf(&cd_bdevsw, (unit * 8 ) + RAW_PART, DV_BLK,
+ CD_UID, CD_GID, 0600, "cd%dc", unit);
#endif
return 0;
diff --git a/sys/scsi/sctarg.c b/sys/scsi/sctarg.c
index b0d09578bc1f..869d2702e27a 100644
--- a/sys/scsi/sctarg.c
+++ b/sys/scsi/sctarg.c
@@ -37,7 +37,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sctarg.c,v 1.13 1996/01/05 20:12:47 wollman Exp $
+ * $Id: sctarg.c,v 1.14 1996/03/10 07:13:11 gibbs Exp $
*/
/*
@@ -270,11 +270,13 @@ sctarg_strategy(struct buf *bp, struct scsi_link *sc_link)
}
static sctarg_devsw_installed = 0;
+#ifdef DEVFS
+static void *sctarg_devfs_token;
+#endif
static void sctarg_drvinit(void *unused)
{
dev_t dev;
- void *x;
if( ! sctarg_devsw_installed ) {
dev = makedev(CDEV_MAJOR, 0);
@@ -282,8 +284,9 @@ static void sctarg_drvinit(void *unused)
sctarg_devsw_installed = 1;
#ifdef DEVFS
/* XXX should be in ADAPTER code */
- x=devfs_add_devsw( "/scsi", "sctarg", &sctarg_cdevsw, 0,
- DV_CHR, 0, 0, 0600);
+ sctarg_devfs_token =
+ devfs_add_devswf(&sctarg_cdevsw, 0, DV_CHR, 0, 0,
+ 0600, "sctarg");
#endif
}
}
diff --git a/sys/scsi/ssc.c b/sys/scsi/ssc.c
index cb90d9134f20..fbfa8b6a18fb 100644
--- a/sys/scsi/ssc.c
+++ b/sys/scsi/ssc.c
@@ -49,7 +49,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*End copyright
- * $Id: ssc.c,v 1.9 1995/12/08 23:22:26 phk Exp $
+ * $Id: ssc.c,v 1.10 1995/12/10 20:34:49 bde Exp $
*/
#include <sys/types.h>
@@ -134,7 +134,9 @@ sscioctl(dev_t dev, int cmd, caddr_t data, int fflag, struct proc *p)
*/
static ssc_devsw_installed = 0;
+#ifdev DEVFS
static void *ssc_devfs_token;
+#endif
static void
ssc_drvinit(void *unused)
@@ -146,9 +148,9 @@ ssc_drvinit(void *unused)
cdevsw_add(&dev,&ssc_cdevsw, NULL);
ssc_devsw_installed = 1;
#ifdef DEVFS
- ssc_devfs_token = devfs_add_devsw(
- "/scsi", "ssc", &ssc_cdevsw, 0,
- DV_CHR, 0, 0, 0600);
+ ssc_devfs_token =
+ devfs_add_devswf(&ssc_cdevsw, 0, DV_CHR, 0, 0,
+ 0600, "ssc");
#endif
}
}
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 28b32bbb719a..5f7130edb4e1 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -12,7 +12,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
- * $Id: st.c,v 1.63 1996/03/10 07:13:14 gibbs Exp $
+ * $Id: st.c,v 1.64 1996/03/27 18:50:10 bde Exp $
*/
/*
@@ -275,9 +275,6 @@ static errval
stattach(struct scsi_link *sc_link)
{
u_int32_t unit;
-#ifdef DEVFS
- char name[32];
-#endif
struct scsi_data *st = sc_link->sd;
diff --git a/sys/scsi/worm.c b/sys/scsi/worm.c
index 0895ad6debcb..6547005f138d 100644
--- a/sys/scsi/worm.c
+++ b/sys/scsi/worm.c
@@ -43,7 +43,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: worm.c,v 1.25 1996/03/10 07:13:15 gibbs Exp $
+ * $Id: worm.c,v 1.26 1996/03/10 12:52:47 jkh Exp $
*/
/* XXX This is PRELIMINARY.
@@ -235,7 +235,6 @@ static errval
wormattach(struct scsi_link *sc_link)
{
#ifdef DEVFS
- char name[20];
int mynor;
#endif
struct scsi_data *worm = sc_link->sd;
@@ -250,15 +249,12 @@ wormattach(struct scsi_link *sc_link)
printf("with %ld blocks.", worm->n_blks);
#ifdef DEVFS
mynor = wormunit(sc_link->dev);
- sprintf(name, "rworm%d", mynor);
worm->devfs_token =
- devfs_add_devsw("/", name, &worm_cdevsw, mynor,
- DV_CHR, 0, 0, 0600);
- sprintf(name, "rworm%d.ctl", mynor);
+ devfs_add_devswf(&worm_cdevsw, mynor,
+ DV_CHR, 0, 0, 0600, "rworm%d", mynor);
worm->devfs_token =
- devfs_add_devsw("/", name, &worm_cdevsw,
- mynor | SCSI_CONTROL_MASK,
- DV_CHR, 0, 0, 0600);
+ devfs_add_devswf(&worm_cdevsw, mynor | SCSI_CONTROL_MASK,
+ DV_CHR, 0, 0, 0600, "rworm%d.ctl", mynor);
#endif
return 0;
}