summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/asc.c24
-rw-r--r--sys/i386/isa/atapi-cd.c9
-rw-r--r--sys/i386/isa/ctx.c24
-rw-r--r--sys/i386/isa/cx.c7
-rw-r--r--sys/i386/isa/cy.c6
-rw-r--r--sys/i386/isa/gpib.c21
-rw-r--r--sys/i386/isa/gsc.c22
-rw-r--r--sys/i386/isa/ida.c4
-rw-r--r--sys/i386/isa/istallion.c21
-rw-r--r--sys/i386/isa/joy.c20
-rw-r--r--sys/i386/isa/labpc.c19
-rw-r--r--sys/i386/isa/loran.c24
-rw-r--r--sys/i386/isa/matcd/matcd.c21
-rw-r--r--sys/i386/isa/mcd.c21
-rw-r--r--sys/i386/isa/mse.c21
-rw-r--r--sys/i386/isa/pcaudio.c18
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c6
-rw-r--r--sys/i386/isa/rc.c20
-rw-r--r--sys/i386/isa/rp.c10
-rw-r--r--sys/i386/isa/scd.c21
-rw-r--r--sys/i386/isa/si.c9
-rw-r--r--sys/i386/isa/snd/sound.c4
-rw-r--r--sys/i386/isa/sound/soundcard.c7
-rw-r--r--sys/i386/isa/spigot.c21
-rw-r--r--sys/i386/isa/spkr.c18
-rw-r--r--sys/i386/isa/stallion.c9
-rw-r--r--sys/i386/isa/tw.c20
-rw-r--r--sys/i386/isa/wd.c13
-rw-r--r--sys/i386/isa/wd_cd.c9
-rw-r--r--sys/i386/isa/wfd.c10
-rw-r--r--sys/i386/isa/wst.c12
-rw-r--r--sys/i386/isa/wt.c25
32 files changed, 100 insertions, 396 deletions
diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c
index 4a6a071..700271a 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.36 1999/05/06 18:12:24 peter Exp $
+ * $Id: asc.c,v 1.37 1999/05/30 16:52:07 phk Exp $
*/
#include "asc.h"
@@ -379,6 +379,10 @@ ascprobe (struct isa_device *isdp)
int unit = isdp->id_unit;
struct asc_unit *scu = unittab + unit;
int stb;
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&asc_cdevsw);
scu->base = isdp->id_iobase; /*** needed by the following macros ***/
scu->flags = FLAG_DEBUG;
@@ -899,22 +903,4 @@ ascpoll(dev_t dev, int events, struct proc *p)
return 0;
}
-
-static int asc_devsw_installed;
-
-static void
-asc_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! asc_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&asc_cdevsw,NULL);
- asc_devsw_installed = 1;
- }
-}
-
-SYSINIT(ascdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,asc_drvinit,NULL)
-
-
#endif /* NASC > 0 */
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c
index 644fb3f..0613e7e 100644
--- a/sys/i386/isa/atapi-cd.c
+++ b/sys/i386/isa/atapi-cd.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: atapi-cd.c,v 1.18 1999/05/11 10:39:27 sos Exp $
+ * $Id: atapi-cd.c,v 1.19 1999/05/30 16:52:08 phk Exp $
*/
#include "wdc.h"
@@ -1496,15 +1496,10 @@ atapi_dump(int ctrlr, int lun, char *label, void *data, int len)
printf ("\n");
}
-static int acd_devsw_installed;
-
static void
acd_drvinit(void *unused)
{
- if (!acd_devsw_installed) {
- cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &acd_cdevsw);
- acd_devsw_installed = 1;
- }
+ cdevsw_add(&acd_cdevsw);
}
SYSINIT(acddev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE + CDEV_MAJOR, acd_drvinit, NULL)
diff --git a/sys/i386/isa/ctx.c b/sys/i386/isa/ctx.c
index f1b5953..0fc5f1e 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.30 1999/04/28 10:52:19 dt Exp $
+ * $Id: ctx.c,v 1.31 1999/05/30 16:52:09 phk Exp $
*/
/*
@@ -192,7 +192,10 @@ static int
ctxprobe(struct isa_device * devp)
{
int status;
+ static int once;
+ if (!once++)
+ cdevsw_add(&ctx_cdevsw);
if (inb(devp->id_iobase) == 0xff) /* 0xff only if board absent */
status = 0;
else {
@@ -463,23 +466,4 @@ waitvb(int port)
return (0);
}
-
-
-static int ctx_devsw_installed;
-
-static void
-ctx_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! ctx_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&ctx_cdevsw,NULL);
- ctx_devsw_installed = 1;
- }
-}
-
-SYSINIT(ctxdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ctx_drvinit,NULL)
-
-
#endif /* NCTX > 0 */
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index 7f5624e..2b02732 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -981,13 +981,8 @@ void cxtimeout (void *a)
static int cx_devsw_installed;
static void cx_drvinit(void *unused)
{
- dev_t dev;
- if( ! cx_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&cx_cdevsw,NULL);
- cx_devsw_installed = 1;
- }
+ cdevsw_add(&cx_cdevsw);
}
SYSINIT(cxdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cx_drvinit,NULL)
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 70d0466..dd98d7a 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,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: cy.c,v 1.88 1999/05/28 13:23:21 bde Exp $
+ * $Id: cy.c,v 1.89 1999/05/30 16:52:11 phk Exp $
*/
#include "opt_compat.h"
@@ -541,7 +541,6 @@ cyattach_common(cy_iobase, cy_align)
{
int adapter;
int cyu;
- dev_t dev;
u_char firmware_version;
cy_addr iobase;
int ncyu;
@@ -633,8 +632,7 @@ cyattach_common(cy_iobase, cy_align)
splx(s);
if (!sio_registered) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &sio_cdevsw, NULL);
+ cdevsw_add(&sio_cdevsw);
register_swi(SWI_TTY, siopoll);
sio_registered = TRUE;
}
diff --git a/sys/i386/isa/gpib.c b/sys/i386/isa/gpib.c
index cf67cdc..1aff398 100644
--- a/sys/i386/isa/gpib.c
+++ b/sys/i386/isa/gpib.c
@@ -123,7 +123,10 @@ gpprobe(struct isa_device *dvp)
{
int status;
struct gpib_softc *sc = &gpib_sc;
+ static int once;
+ if (!once++)
+ cdevsw_add(&gp_cdevsw);
gpib_port = dvp->id_iobase;
status=1;
@@ -1175,22 +1178,4 @@ outb(CDOR,95); /*untalk*/
}
-
-static int gp_devsw_installed;
-
-static void
-gp_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! gp_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&gp_cdevsw, NULL);
- gp_devsw_installed = 1;
- }
-}
-
-SYSINIT(gpdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,gp_drvinit,NULL)
-
-
#endif /* NGPIB > 0 */
diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c
index 9ac7b43..48bd5f2 100644
--- a/sys/i386/isa/gsc.c
+++ b/sys/i386/isa/gsc.c
@@ -402,6 +402,10 @@ gscprobe (struct isa_device *isdp)
struct gsc_unit *scu = unittab + unit;
int stb;
struct gsc_geom geom = NEW_GEOM;
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&gsc_cdevsw);
scu->flags = FLAG_DEBUG;
@@ -849,22 +853,4 @@ gscioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
}
}
-
-static int gsc_devsw_installed;
-
-static void
-gsc_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! gsc_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&gsc_cdevsw, NULL);
- gsc_devsw_installed = 1;
- }
-}
-
-SYSINIT(gscdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,gsc_drvinit,NULL)
-
-
#endif /* NGSC > 0 */
diff --git a/sys/i386/isa/ida.c b/sys/i386/isa/ida.c
index 5e78ec8..919d365 100644
--- a/sys/i386/isa/ida.c
+++ b/sys/i386/isa/ida.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: ida.c,v 1.1 1999/05/25 19:45:17 julian Exp $
*
*/
@@ -1733,7 +1733,7 @@ static void
id_drvinit(void *unused)
{
if( ! id_devsw_installed ) {
- cdevsw_add_generic(ID_BDMAJ,ID_CDMAJ, &id_cdevsw);
+ cdevsw_add(&id_cdevsw);
id_devsw_installed = 1;
}
}
diff --git a/sys/i386/isa/istallion.c b/sys/i386/isa/istallion.c
index 0ade414..b93e3ca 100644
--- a/sys/i386/isa/istallion.c
+++ b/sys/i386/isa/istallion.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: istallion.c,v 1.27 1999/05/08 07:02:29 phk Exp $
+ * $Id: istallion.c,v 1.28 1999/05/30 16:52:16 phk Exp $
*/
/*****************************************************************************/
@@ -662,21 +662,6 @@ static struct cdevsw stli_cdevsw = {
/* bmaj */ -1
};
-static int stli_devsw_installed;
-
-static void stli_drvinit(void *unused)
-{
- dev_t dev;
-
- if (! stli_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &stli_cdevsw, NULL);
- stli_devsw_installed = 1;
- }
-}
-
-SYSINIT(sidev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,stli_drvinit,NULL)
-
#endif
/*****************************************************************************/
@@ -835,6 +820,10 @@ static int stliprobe(struct isa_device *idp)
{
stlibrd_t *brdp;
int btype, bclass;
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&stli_cdevsw);
#if DEBUG
printf("stliprobe(idp=%x): unit=%d iobase=%x flags=%x\n", (int) idp,
diff --git a/sys/i386/isa/joy.c b/sys/i386/isa/joy.c
index 6847f43..a2edbd5 100644
--- a/sys/i386/isa/joy.c
+++ b/sys/i386/isa/joy.c
@@ -120,6 +120,10 @@ static int get_tick __P((void));
static int
joyprobe (struct isa_device *dev)
{
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&joy_cdevsw);
#ifdef WANT_JOYSTICK_CONNECTED
outb (dev->id_iobase, 0xff);
DELAY (10000); /* 10 ms delay */
@@ -251,22 +255,6 @@ get_tick ()
return (high << 8) | low;
}
-
-static int joy_devsw_installed;
-
-static void joy_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! joy_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&joy_cdevsw,NULL);
- joy_devsw_installed = 1;
- }
-}
-
-SYSINIT(joydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,joy_drvinit,NULL)
-
#ifdef JOY_MODULE
#include <sys/exec.h>
diff --git a/sys/i386/isa/labpc.c b/sys/i386/isa/labpc.c
index 180252b..d1b9798 100644
--- a/sys/i386/isa/labpc.c
+++ b/sys/i386/isa/labpc.c
@@ -417,6 +417,7 @@ labpcinit(void)
bzero(labpcs, NLABPC * sizeof(struct ctlr *));
return 1;
}
+ cdevsw_add(&labpc_cdevsw);
return 0;
}
@@ -1099,21 +1100,3 @@ labpcioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc *p)
return ENOTTY;
}
}
-
-
-static int labpc_devsw_installed = 0;
-
-static void labpc_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! labpc_devsw_installed ) {
- dev = makedev(CDEV_MAJOR,0);
- cdevsw_add(&dev,&labpc_cdevsw,NULL);
- labpc_devsw_installed = 1;
- }
-}
-
-SYSINIT(labpcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,labpc_drvinit,NULL)
-
-
diff --git a/sys/i386/isa/loran.c b/sys/i386/isa/loran.c
index 2769d41..09e8639 100644
--- a/sys/i386/isa/loran.c
+++ b/sys/i386/isa/loran.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: loran.c,v 1.18 1999/05/08 14:36:48 phk Exp $
+ * $Id: loran.c,v 1.19 1999/05/30 16:52:19 phk Exp $
*
* This device-driver helps the userland controlprogram for a LORAN-C
* receiver avoid monopolizing the CPU.
@@ -196,6 +196,8 @@ struct datapoint {
/**********************************************************************/
+extern struct cdevsw loran_cdevsw;
+
static dphead_t minors[NLORAN], working, holding;
static struct datapoint dummy[NDUMMY];
@@ -233,6 +235,10 @@ extern struct timecounter loran_timecounter;
int
loranprobe(struct isa_device *dvp)
{
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&loran_cdevsw);
/* We need to be a "fast-intr" */
dvp->id_ri_flags |= RI_FAST;
@@ -657,20 +663,4 @@ static struct cdevsw loran_cdevsw = {
/* bmaj */ -1
};
-
-static int loran_devsw_installed;
-
-static void loran_drvinit(void *unused)
-{
- dev_t dev;
-
- if(!loran_devsw_installed) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&loran_cdevsw, NULL);
- loran_devsw_installed = 1;
- }
-}
-
-SYSINIT(lorandev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,loran_drvinit,NULL)
-
#endif /* KERNEL */
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index fb4a261..102aff8 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.39 1999/05/07 07:03:36 phk Exp $ */
+/* $Id: matcd.c,v 1.40 1999/05/30 16:52:35 phk Exp $ */
/*---------------------------------------------------------------------------
Include declarations
@@ -1214,7 +1214,10 @@ matcd_probe(struct isa_device *dev)
int i,cdrive;
unsigned char y;
int port = dev->id_iobase; /*Take port hint from config file*/
+ static int once;
+ if (!once++)
+ cdevsw_add(&matcd_cdevsw);
cdrive=nextcontroller; /*Controller defined by pass for now*/
if (nextcontroller==NUMCTRLRS) {
printf("matcdc%d: - Too many interfaces specified in config\n",
@@ -2737,21 +2740,5 @@ static int matcd_igot(struct ioc_capability * sqp)
audio are here*/
#endif /*FULLDRIVER*/
-
-static int matcd_devsw_installed;
-
-static void
-matcd_drvinit(void *unused)
-{
-
- if( ! matcd_devsw_installed ) {
- cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &matcd_cdevsw);
- matcd_devsw_installed = 1;
- }
-}
-
-SYSINIT(matcddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,matcd_drvinit,NULL)
-
-
/*End of matcd.c*/
diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c
index c57a675..17e9b0c 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.106 1999/05/08 07:02:30 phk Exp $
+ * $Id: mcd.c,v 1.107 1999/05/30 16:52:19 phk Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -756,6 +756,10 @@ mcd_probe(struct isa_device *dev)
int unit = dev->id_unit;
int i, j;
unsigned char stbytes[3];
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&mcd_cdevsw);
mcd_data[unit].flags = MCDPROBING;
@@ -1856,19 +1860,4 @@ mcd_resume(int unit)
return mcd_play(unit, &cd->lastpb);
}
-
-static int mcd_devsw_installed;
-
-static void mcd_drvinit(void *unused)
-{
-
- if( ! mcd_devsw_installed ) {
- cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &mcd_cdevsw);
- mcd_devsw_installed = 1;
- }
-}
-
-SYSINIT(mcddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,mcd_drvinit,NULL)
-
-
#endif /* NMCD > 0 */
diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c
index b70cf15..a8676bc 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.42 1999/05/06 18:44:02 peter Exp $
+ * $Id: mse.c,v 1.43 1999/05/30 16:52:20 phk Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -248,7 +248,10 @@ mseprobe(idp)
{
register struct mse_softc *sc = &mse_sc[idp->id_unit];
register int i;
+ static int once;
+ if (!once++)
+ cdevsw_add(&mse_cdevsw);
/*
* Check for each mouse type in the table.
*/
@@ -788,20 +791,4 @@ mse_getati(port, dx, dy, but)
outb(port + MSE_PORTB, MSE_INPORT_INTREN);
}
-static int mse_devsw_installed;
-
-static void mse_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! mse_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&mse_cdevsw, NULL);
- mse_devsw_installed = 1;
- }
-}
-
-SYSINIT(msedev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,mse_drvinit,NULL)
-
-
#endif /* NMSE */
diff --git a/sys/i386/isa/pcaudio.c b/sys/i386/isa/pcaudio.c
index c44bc55..8ed04da 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.48 1999/05/06 18:58:05 peter Exp $
+ * $Id: pcaudio.c,v 1.49 1999/05/30 16:52:21 phk Exp $
*/
#include "pca.h"
@@ -204,6 +204,7 @@ pca_volume(int volume)
static void
pca_init(void)
{
+ cdevsw_add(&pca_cdevsw);
pca_status.open = 0;
pca_status.queries = 0;
pca_status.timer_on = 0;
@@ -565,19 +566,4 @@ pcapoll(dev_t dev, int events, struct proc *p)
return (revents);
}
-static int pca_devsw_installed;
-
-static void pca_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! pca_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&pca_cdevsw, NULL);
- pca_devsw_installed = 1;
- }
-}
-
-SYSINIT(pcadev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,pca_drvinit,NULL)
-
#endif
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index aad4fed..a0dd214 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -386,11 +386,7 @@ pcattach(struct isa_device *dev)
async_update(UPDATE_START); /* start asynchronous updates */
#if PCVT_FREEBSD > 205
- {
- dev_t dev = makedev(CDEV_MAJOR, 0);
-
- cdevsw_add(&dev, &pc_cdevsw, NULL);
- }
+ cdevsw_add(&pc_cdevsw);
#ifdef DEVFS
for(vt = 0; vt < MAXCONS; vt++) {
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index fdcbcf6..8e0fdc5 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -213,6 +213,10 @@ rcprobe(dvp)
{
int irq = ffs(dvp->id_irq) - 1;
register int nec = dvp->id_iobase;
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&rc_cdevsw);
if (dvp->id_unit > NRC)
return 0;
@@ -1510,20 +1514,4 @@ rc_wait0(nec, unit, chan, line)
unit, chan, line);
}
-static int rc_devsw_installed;
-
-static void rc_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! rc_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&rc_cdevsw, NULL);
- rc_devsw_installed = 1;
- }
-}
-
-SYSINIT(rcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,rc_drvinit,NULL)
-
-
#endif /* NRC */
diff --git a/sys/i386/isa/rp.c b/sys/i386/isa/rp.c
index a3c2382..c1913a0 100644
--- a/sys/i386/isa/rp.c
+++ b/sys/i386/isa/rp.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: rp.c,v 1.26 1999/05/09 17:07:20 peter Exp $
+ * $Id: rp.c,v 1.27 1999/05/30 16:52:22 phk Exp $
*/
/*
@@ -1085,7 +1085,6 @@ struct isa_device *dev;
static void
rp_pciattach(pcici_t tag, int unit)
{
- dev_t rp_dev;
int success, oldspl;
u_short iobase;
int num_ports, num_chan, num_aiops;
@@ -1140,8 +1139,7 @@ rp_pciattach(pcici_t tag, int unit)
rp_addr(unit) = rp;
splx(oldspl);
- rp_dev = makedev(CDEV_MAJOR, unit);
- cdevsw_add(&rp_dev, &rp_cdevsw, NULL);
+ cdevsw_add(&rp_cdevsw);
port = 0;
for(aiop=0; aiop < num_aiops; aiop++) {
@@ -1196,7 +1194,6 @@ int
rpattach(dev)
struct isa_device *dev;
{
- dev_t rp_dev;
int iobase, unit, /*rpmajor,*/ oldspl;
int num_ports, num_chan, num_aiops;
int aiop, chan, port;
@@ -1252,8 +1249,7 @@ struct isa_device *dev;
rp_addr(unit) = rp;
splx(oldspl);
- rp_dev = makedev(CDEV_MAJOR, unit);
- cdevsw_add(&rp_dev, &rp_cdevsw, NULL);
+ cdevsw_add(&rp_cdevsw);
port = 0;
for(aiop=0; aiop < num_aiops; aiop++) {
diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c
index 24af2e1..ff4832d 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.45 1999/05/09 20:29:04 phk Exp $ */
+/* $Id: scd.c,v 1.46 1999/05/30 16:52:24 phk Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -718,6 +718,10 @@ scd_probe(struct isa_device *dev)
static char namebuf[8+16+8+3];
char *s = namebuf;
int loop_count = 0;
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&scd_cdevsw);
scd_data[unit].flags = SCDPROBING;
scd_data[unit].iobase = dev->id_iobase;
@@ -1574,19 +1578,4 @@ scd_toc_entry (int unit, struct ioc_read_toc_single_entry *te)
return 0;
}
-
-static int scd_devsw_installed;
-
-static void scd_drvinit(void *unused)
-{
-
- if( ! scd_devsw_installed ) {
- cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &scd_cdevsw);
- scd_devsw_installed = 1;
- }
-}
-
-SYSINIT(scddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,scd_drvinit,NULL)
-
-
#endif /* NSCD > 0 */
diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c
index 0565390..18d8377 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.85 1999/05/09 17:07:21 peter Exp $
+ * $Id: si.c,v 1.86 1999/05/30 16:52:25 phk Exp $
*/
#ifndef lint
@@ -2832,13 +2832,8 @@ static int si_devsw_installed;
static void
si_drvinit(void *unused)
{
- dev_t dev;
- if (!si_devsw_installed) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&si_cdevsw, NULL);
- si_devsw_installed = 1;
- }
+ cdevsw_add(&si_cdevsw);
}
SYSINIT(sidev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,si_drvinit,NULL)
diff --git a/sys/i386/isa/snd/sound.c b/sys/i386/isa/snd/sound.c
index f4be1a6..6737ee5 100644
--- a/sys/i386/isa/snd/sound.c
+++ b/sys/i386/isa/snd/sound.c
@@ -340,10 +340,8 @@ pcminit(snddev_info *d, int unit)
#ifdef DEVFS
void *cookie;
#endif
- dev_t isadev;
- isadev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&isadev, &snd_cdevsw, NULL);
+ cdevsw_add(&snd_cdevsw);
/*
* initialize standard parameters for the device. This can be
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c
index 0d122ae..0c97f90 100644
--- a/sys/i386/isa/sound/soundcard.c
+++ b/sys/i386/isa/sound/soundcard.c
@@ -507,12 +507,7 @@ sndattach(struct isa_device * dev)
sequencer_init();
}
- {
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &snd_cdevsw, NULL);
- }
+ cdevsw_add(&snd_cdevsw);
#ifdef DEVFS
#define GID_SND GID_GAMES
#define UID_SND UID_ROOT
diff --git a/sys/i386/isa/spigot.c b/sys/i386/isa/spigot.c
index 4c8f15d..b2ce86d 100644
--- a/sys/i386/isa/spigot.c
+++ b/sys/i386/isa/spigot.c
@@ -131,6 +131,10 @@ spigot_probe(struct isa_device *devp)
{
int status;
struct spigot_softc *ss=(struct spigot_softc *)&spigot_softc[devp->id_unit];
+static int once;
+
+ if (!once++)
+ cdevsw_add(&spigot_cdevsw);
ss->flags = 0;
ss->maddr = 0;
@@ -291,21 +295,4 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[0];
return i386_btop(ss->maddr);
}
-
-static int spigot_devsw_installed;
-
-static void spigot_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! spigot_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&spigot_cdevsw, NULL);
- spigot_devsw_installed = 1;
- }
-}
-
-SYSINIT(spigotdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spigot_drvinit,NULL)
-
-
#endif /* NSPIGOT */
diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c
index 759a9fc..f594b8b 100644
--- a/sys/i386/isa/spkr.c
+++ b/sys/i386/isa/spkr.c
@@ -4,7 +4,7 @@
* v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993
* modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su>
*
- * $Id: spkr.c,v 1.35 1998/08/24 02:28:16 bde Exp $
+ * $Id: spkr.c,v 1.36 1999/05/30 16:52:27 phk Exp $
*/
#include "speaker.h"
@@ -601,24 +601,14 @@ spkrioctl(dev, cmd, cmdarg, flags, p)
return(EINVAL);
}
-
-static int spkr_devsw_installed;
-
static void
spkr_drvinit(void *unused)
{
- dev_t dev;
-
- if( ! spkr_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&spkr_cdevsw, NULL);
- spkr_devsw_installed = 1;
+ cdevsw_add(&spkr_cdevsw);
#ifdef DEVFS
- devfs_token = devfs_add_devswf(&spkr_cdevsw, 0, DV_CHR,
- UID_ROOT, GID_WHEEL, 0600,
- "speaker");
+ devfs_token = devfs_add_devswf(&spkr_cdevsw, 0, DV_CHR,
+ UID_ROOT, GID_WHEEL, 0600, "speaker");
#endif
- }
}
SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL)
diff --git a/sys/i386/isa/stallion.c b/sys/i386/isa/stallion.c
index 91cec5d..d817409 100644
--- a/sys/i386/isa/stallion.c
+++ b/sys/i386/isa/stallion.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: stallion.c,v 1.31 1999/05/09 17:07:22 peter Exp $
+ * $Id: stallion.c,v 1.32 1999/05/30 16:52:27 phk Exp $
*/
/*****************************************************************************/
@@ -561,13 +561,8 @@ static int stl_devsw_installed;
static void stl_drvinit(void *unused)
{
- dev_t dev;
- if (! stl_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &stl_cdevsw, NULL);
- stl_devsw_installed = 1;
- }
+ cdevsw_add(&stl_cdevsw);
}
SYSINIT(sidev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,stl_drvinit,NULL)
diff --git a/sys/i386/isa/tw.c b/sys/i386/isa/tw.c
index 3385a85..c7de9d3 100644
--- a/sys/i386/isa/tw.c
+++ b/sys/i386/isa/tw.c
@@ -359,7 +359,10 @@ static int twprobe(idp)
struct tw_sc sc;
int d;
int tries;
+ static int once;
+ if (!once++)
+ cdevsw_add(&tw_cdevsw);
sc.sc_port = idp->id_iobase;
/* Search for the zero crossing signal at ports, bit combinations. */
tw_zcport = tw_control;
@@ -1168,21 +1171,4 @@ static int twchecktime(int target, int tol)
}
#endif /* HIRESTIME */
-
-static int tw_devsw_installed;
-
-static void tw_drvinit(void *unused)
-{
- dev_t dev;
-
- if( ! tw_devsw_installed ) {
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev,&tw_cdevsw, NULL);
- tw_devsw_installed = 1;
- }
-}
-
-SYSINIT(twdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,tw_drvinit,NULL)
-
-
#endif /* NTW */
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index 78ad4e6..6a5100a 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.197 1999/05/08 18:13:15 peter Exp $
+ * $Id: wd.c,v 1.198 1999/05/30 16:52:29 phk Exp $
*/
/* TODO:
@@ -2386,17 +2386,12 @@ wdwait(struct disk *du, u_char bits_wanted, int timeout)
return (-1);
}
-static int wd_devsw_installed;
-
static void wd_drvinit(void *unused)
{
- if( ! wd_devsw_installed ) {
- if (wd_cdevsw.d_maxio == 0)
- wd_cdevsw.d_maxio = 248 * 512;
- cdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &wd_cdevsw);
- wd_devsw_installed = 1;
- }
+ if (wd_cdevsw.d_maxio == 0)
+ wd_cdevsw.d_maxio = 248 * 512;
+ cdevsw_add(&wd_cdevsw);
}
SYSINIT(wddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wd_drvinit,NULL)
diff --git a/sys/i386/isa/wd_cd.c b/sys/i386/isa/wd_cd.c
index 644fb3f..0613e7e 100644
--- a/sys/i386/isa/wd_cd.c
+++ b/sys/i386/isa/wd_cd.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: atapi-cd.c,v 1.18 1999/05/11 10:39:27 sos Exp $
+ * $Id: atapi-cd.c,v 1.19 1999/05/30 16:52:08 phk Exp $
*/
#include "wdc.h"
@@ -1496,15 +1496,10 @@ atapi_dump(int ctrlr, int lun, char *label, void *data, int len)
printf ("\n");
}
-static int acd_devsw_installed;
-
static void
acd_drvinit(void *unused)
{
- if (!acd_devsw_installed) {
- cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &acd_cdevsw);
- acd_devsw_installed = 1;
- }
+ cdevsw_add(&acd_cdevsw);
}
SYSINIT(acddev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE + CDEV_MAJOR, acd_drvinit, NULL)
diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c
index d03a201..d053cb8 100644
--- a/sys/i386/isa/wfd.c
+++ b/sys/i386/isa/wfd.c
@@ -23,7 +23,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: wfd.c,v 1.23 1999/05/07 07:03:31 phk Exp $
+ * $Id: wfd.c,v 1.24 1999/05/30 16:52:30 phk Exp $
*/
/*
@@ -765,17 +765,11 @@ static int wfd_eject (struct wfd *t, int closeit)
0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0);
}
-static int wfd_devsw_installed;
-
static void wfd_drvinit(void *unused)
{
- if( ! wfd_devsw_installed ) {
- cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &wfd_cdevsw);
- wfd_devsw_installed = 1;
- }
+ cdevsw_add(&wfd_cdevsw);
}
SYSINIT(wfddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wfd_drvinit,NULL)
-
#endif /* NWFD && NWDC */
diff --git a/sys/i386/isa/wst.c b/sys/i386/isa/wst.c
index 82832d4..94d4146 100644
--- a/sys/i386/isa/wst.c
+++ b/sys/i386/isa/wst.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: wst.c,v 1.21 1999/05/07 07:03:32 phk Exp $
+ * $Id: wst.c,v 1.22 1999/05/30 16:52:30 phk Exp $
*/
#include "wdc.h"
@@ -787,18 +787,10 @@ wst_reset(struct wst *t)
DELAY(30);
}
-static int wst_devsw_installed;
-
static void
wst_drvinit(void *unused)
{
- if (!wst_devsw_installed) {
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &wst_cdevsw, NULL);
- wst_devsw_installed = 1;
- }
+ cdevsw_add(&wst_cdevsw);
}
SYSINIT(wstdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wst_drvinit,NULL)
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index 650cc0b..73ccab3 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.50 1999/05/07 07:03:33 phk Exp $
+ * $Id: wt.c,v 1.51 1999/05/30 16:52:31 phk Exp $
*
*/
@@ -223,6 +223,10 @@ static int
wtprobe (struct isa_device *id)
{
wtinfo_t *t = wttab + id->id_unit;
+ static int once;
+
+ if (!once++)
+ cdevsw_add(&wt_cdevsw);
t->unit = id->id_unit;
t->chan = id->id_drq;
@@ -993,23 +997,4 @@ wtstatus (wtinfo_t *t)
return (1);
}
-
-static int wt_devsw_installed;
-
-static void
-wt_drvinit(void *unused)
-{
-
- if( ! wt_devsw_installed ) {
- dev_t dev;
-
- dev = makedev(CDEV_MAJOR, 0);
- cdevsw_add(&dev, &wt_cdevsw, NULL);
- wt_devsw_installed = 1;
- }
-}
-
-SYSINIT(wtdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,wt_drvinit,NULL)
-
-
#endif /* NWT */
OpenPOWER on IntegriCloud