summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-05-31 11:29:30 +0000
committerphk <phk@FreeBSD.org>1999-05-31 11:29:30 +0000
commit6a5dc97620c08ad609e1b3c3c042f150feb46dd3 (patch)
tree6cfc9338ae83f67fd38a853cd0782713c73cad13 /sys/cam
parent881e2636833297a207a791fabd8befc818b1b3fb (diff)
downloadFreeBSD-src-6a5dc97620c08ad609e1b3c3c042f150feb46dd3.zip
FreeBSD-src-6a5dc97620c08ad609e1b3c3c042f150feb46dd3.tar.gz
Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c7
-rw-r--r--sys/cam/scsi/scsi_cd.c4
-rw-r--r--sys/cam/scsi/scsi_ch.c7
-rw-r--r--sys/cam/scsi/scsi_da.c4
-rw-r--r--sys/cam/scsi/scsi_pass.c7
-rw-r--r--sys/cam/scsi/scsi_pt.c7
-rw-r--r--sys/cam/scsi/scsi_sa.c4
-rw-r--r--sys/cam/scsi/scsi_target.c6
8 files changed, 16 insertions, 30 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 2ae2b3f..be9d717 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_xpt.c,v 1.61 1999/05/25 20:17:29 gibbs Exp $
+ * $Id: cam_xpt.c,v 1.62 1999/05/30 16:50:57 phk Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -825,10 +825,7 @@ dev_allocq_is_runnable(struct cam_devq *devq)
static void
xpt_periph_init()
{
- dev_t dev;
-
- dev = makedev(XPT_CDEV_MAJOR, 0);
- cdevsw_add(&dev, &xpt_cdevsw, NULL);
+ cdevsw_add(&xpt_cdevsw);
}
static void
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 730d97f..fe353e4 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_cd.c,v 1.21 1999/05/22 22:00:18 gibbs Exp $
+ * $Id: scsi_cd.c,v 1.22 1999/05/30 16:51:00 phk Exp $
*/
/*
* Portions of this driver taken from the original FreeBSD cd driver.
@@ -346,7 +346,7 @@ cdinit(void)
"due to status 0x%x!\n", status);
} else {
/* If we were successfull, register our devsw */
- cdevsw_add_generic(CD_BDEV_MAJOR, CD_CDEV_MAJOR, &cd_cdevsw);
+ cdevsw_add(&cd_cdevsw);
}
}
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 6fd7aee..146002f 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_ch.c,v 1.12 1999/05/22 22:00:19 gibbs Exp $
+ * $Id: scsi_ch.c,v 1.13 1999/05/30 16:51:01 phk Exp $
*/
/*
* Derived from the NetBSD SCSI changer driver.
@@ -277,11 +277,8 @@ chinit(void)
printf("ch: Failed to attach master async callback "
"due to status 0x%x!\n", status);
} else {
- dev_t dev;
-
/* If we were successfull, register our devsw */
- dev = makedev(CH_CDEV_MAJOR, 0);
- cdevsw_add(&dev, &ch_cdevsw, NULL);
+ cdevsw_add(&ch_cdevsw);
}
}
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 598a054..a8b8541 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_da.c,v 1.25 1999/05/22 22:00:20 gibbs Exp $
+ * $Id: scsi_da.c,v 1.26 1999/05/30 16:51:02 phk Exp $
*/
#include "opt_hw_wdog.h"
@@ -821,7 +821,7 @@ dainit(void)
int err;
/* If we were successfull, register our devsw */
- cdevsw_add_generic(DA_BDEV_MAJOR, DA_CDEV_MAJOR, &da_cdevsw);
+ cdevsw_add(&da_cdevsw);
/*
* Schedule a periodic event to occasioanly send an
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index a350c8e..c68fb98 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pass.c,v 1.10 1999/05/22 22:00:21 gibbs Exp $
+ * $Id: scsi_pass.c,v 1.11 1999/05/30 16:51:03 phk Exp $
*/
#include <sys/param.h>
@@ -184,11 +184,8 @@ passinit(void)
printf("pass: Failed to attach master async callback "
"due to status 0x%x!\n", status);
} else {
- dev_t dev;
-
/* If we were successfull, register our devsw */
- dev = makedev(PASS_CDEV_MAJOR, 0);
- cdevsw_add(&dev, &pass_cdevsw, NULL);
+ cdevsw_add(&pass_cdevsw);
}
}
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index 3041591..e015c36 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pt.c,v 1.8 1999/05/22 22:00:22 gibbs Exp $
+ * $Id: scsi_pt.c,v 1.9 1999/05/30 16:51:05 phk Exp $
*/
#include <sys/param.h>
@@ -304,10 +304,7 @@ ptinit(void)
"due to status 0x%x!\n", status);
} else {
/* If we were successfull, register our devsw */
- dev_t dev;
-
- dev = makedev(PT_CDEV_MAJOR, 0);
- cdevsw_add(&dev,&pt_cdevsw, NULL);
+ cdevsw_add(&pt_cdevsw);
}
}
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 1761055..5e70261 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -1,5 +1,5 @@
/*
- * $Id: scsi_sa.c,v 1.26 1999/05/25 23:10:54 mjacob Exp $
+ * $Id: scsi_sa.c,v 1.27 1999/05/30 16:51:07 phk Exp $
*
* Implementation of SCSI Sequential Access Peripheral driver for CAM.
*
@@ -1148,7 +1148,7 @@ sainit(void)
"due to status 0x%x!\n", status);
} else {
/* If we were successfull, register our devsw */
- cdevsw_add_generic(SA_BDEV_MAJOR, SA_CDEV_MAJOR, &sa_cdevsw);
+ cdevsw_add(&sa_cdevsw);
}
}
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index 302e23f..63d9519 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_target.c,v 1.12 1999/05/22 22:00:24 gibbs Exp $
+ * $Id: scsi_target.c,v 1.13 1999/05/30 16:51:07 phk Exp $
*/
#include <stddef.h> /* For offsetof */
@@ -196,7 +196,6 @@ static struct extend_array *targperiphs;
static void
targinit(void)
{
- dev_t dev;
/*
* Create our extend array for storing the devices we attach to.
@@ -208,8 +207,7 @@ targinit(void)
}
/* If we were successfull, register our devsw */
- dev = makedev(TARG_CDEV_MAJOR, 0);
- cdevsw_add(&dev,&targ_cdevsw, NULL);
+ cdevsw_add(&targ_cdevsw);
}
static void
OpenPOWER on IntegriCloud