From 8954a53be00f18a2f70fdbb1935ea2e03b840879 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Fri, 17 Sep 2010 06:26:22 +0200
Subject: [PATCH] kernel: Get rid of major number definitions.

We don't need those anymore since we have devfs(5) and leaving them
will only lead to confusion (if anything).
---
 sys/bus/cam/cam_xpt.c                     |    4 +---
 sys/bus/cam/scsi/scsi_ch.c                |    3 +--
 sys/bus/cam/scsi/scsi_pass.c              |    4 +---
 sys/bus/cam/scsi/scsi_pt.c                |    4 +---
 sys/bus/cam/scsi/scsi_sa.c                |    4 +---
 sys/bus/cam/scsi/scsi_ses.c               |    3 +--
 sys/bus/cam/scsi/scsi_target.c            |    3 +--
 sys/bus/firewire/fwdev.c                  |    3 +--
 sys/bus/smbus/smb.c                       |    3 +--
 sys/bus/usb/usb.c                         |    2 +-
 sys/bus/usb/usbdi.h                       |    2 --
 sys/dev/acpica5/acpi.c                    |    3 +--
 sys/dev/agp/agp.c                         |    4 +---
 sys/dev/disk/ahci/ahci_dragonfly.h        |    2 --
 sys/dev/disk/ccd/ccd.c                    |    4 +---
 sys/dev/disk/iscsi/initiator/iscsi.c      |    2 +-
 sys/dev/disk/iscsi/initiator/iscsi.h      |    2 --
 sys/dev/disk/isp/isp_freebsd.c            |    4 +---
 sys/dev/disk/md/md.c                      |    4 +---
 sys/dev/disk/sili/sili_dragonfly.h        |    2 --
 sys/dev/disk/vn/vn.c                      |    4 +---
 sys/dev/disk/wt/wt.c                      |    4 +---
 sys/dev/drm/drm.h                         |    1 -
 sys/dev/misc/cmx/cmx.c                    |    3 +--
 sys/dev/misc/dcons/dcons_os.c             |    4 +---
 sys/dev/misc/gpib/gpib.c                  |    3 +--
 sys/dev/misc/hotplug/hotplug.c            |    4 +---
 sys/dev/misc/joy/joy.c                    |    3 +--
 sys/dev/misc/kbd/kbd.c                    |    4 +---
 sys/dev/misc/labpc/labpc.c                |    3 +--
 sys/dev/misc/lpt/lpt.c                    |    3 +--
 sys/dev/misc/mse/mse.c                    |    3 +--
 sys/dev/misc/nmdm/nmdm.c                  |    5 ++---
 sys/dev/misc/pcfclock/pcfclock.c          |    3 +--
 sys/dev/misc/ppi/ppi.c                    |    3 +--
 sys/dev/misc/pps/pps.c                    |    3 +--
 sys/dev/misc/psm/psm.c                    |    4 +---
 sys/dev/misc/snp/snp.c                    |    5 ++---
 sys/dev/misc/spic/spic.c                  |    2 +-
 sys/dev/misc/spic/spicreg.h               |    2 --
 sys/dev/misc/spigot/spigot.c              |    3 +--
 sys/dev/misc/syscons/syscons.c            |    4 +---
 sys/dev/misc/syscons/sysmouse.c           |    6 ++----
 sys/dev/misc/tw/tw.c                      |    3 +--
 sys/dev/raid/aac/aac.c                    |    5 +----
 sys/dev/raid/aac/aacvar.h                 |    5 -----
 sys/dev/raid/amr/amr.c                    |    4 +---
 sys/dev/raid/amr/amr_disk.c               |    4 +---
 sys/dev/raid/ciss/ciss.c                  |    4 +---
 sys/dev/raid/dpt/dpt.h                    |    2 --
 sys/dev/raid/ida/ida_disk.c               |    5 +----
 sys/dev/raid/iir/iir.h                    |    2 --
 sys/dev/raid/iir/iir_ctrl.c               |    5 +----
 sys/dev/raid/ips/ips.c                    |    2 +-
 sys/dev/raid/ips/ips.h                    |    3 ---
 sys/dev/raid/ips/ips_disk.c               |    2 +-
 sys/dev/raid/mlx/mlx.c                    |    4 +---
 sys/dev/raid/mlx/mlx_disk.c               |    4 +---
 sys/dev/raid/mly/mly.c                    |    4 +---
 sys/dev/raid/twe/twe_freebsd.c            |    4 ++--
 sys/dev/raid/twe/twevar.h                 |    3 ---
 sys/dev/serial/cy/cy.c                    |    3 +--
 sys/dev/serial/dgb/dgm.c                  |    3 +--
 sys/dev/serial/digi/digi.c                |    4 +---
 sys/dev/serial/rc/rc.c                    |    3 +--
 sys/dev/serial/rp/rp.c                    |    3 +--
 sys/dev/serial/si/si.c                    |    3 +--
 sys/dev/serial/sio/sio.c                  |    3 +--
 sys/dev/serial/stl/stallion.c             |    5 ++---
 sys/dev/serial/stli/istallion.c           |    3 +--
 sys/dev/sound/pcm/dsp.c                   |    2 +-
 sys/dev/sound/pcm/mixer.c                 |    2 +-
 sys/dev/sound/pcm/sndstat.c               |    2 +-
 sys/dev/sound/pcm/sound.h                 |    5 -----
 sys/dev/usbmisc/ucom/ucom.c               |    4 +---
 sys/dev/usbmisc/ufm/ufm.c                 |    4 +---
 sys/dev/usbmisc/ugen/ugen.c               |    4 +---
 sys/dev/usbmisc/uhid/uhid.c               |    4 +---
 sys/dev/usbmisc/ulpt/ulpt.c               |    4 +---
 sys/dev/usbmisc/ums/ums.c                 |    4 +---
 sys/dev/usbmisc/urio/urio.c               |    4 +---
 sys/dev/usbmisc/uscanner/uscanner.c       |    4 +---
 sys/dev/video/bktr/bktr_os.c              |    3 +--
 sys/dev/video/ctx/ctx.c                   |    3 +--
 sys/dev/video/cxm/cxm.c                   |    4 +---
 sys/dev/video/fb/fb.c                     |    4 +---
 sys/dev/video/gsc/gsc.c                   |    3 +--
 sys/dev/video/meteor/meteor.c             |    3 +--
 sys/dev/virtual/cdrom/vcd.c               |    4 +---
 sys/dev/virtual/disk/vdisk.c              |    4 +---
 sys/kern/kern_descrip.c                   |    6 ++----
 sys/kern/kern_memio.c                     |    5 ++---
 sys/kern/subr_bus.c                       |    4 +---
 sys/kern/subr_log.c                       |    5 ++---
 sys/kern/tty_cons.c                       |    7 +++----
 sys/kern/tty_pty.c                        |    8 +++-----
 sys/kern/tty_tty.c                        |    5 ++---
 sys/net/bpf.c                             |    7 +++----
 sys/net/i4b/driver/i4b_ctl.c              |    4 +---
 sys/net/i4b/driver/i4b_rbch.c             |    4 +---
 sys/net/i4b/driver/i4b_tel.c              |    4 +---
 sys/net/i4b/driver/i4b_trace.c            |    4 +---
 sys/net/i4b/layer4/i4b_i4bdrv.c           |    4 +---
 sys/net/tap/if_tap.c                      |    3 +--
 sys/net/tun/if_tun.c                      |    3 +--
 sys/netproto/smb/smb_dev.c                |    2 +-
 sys/netproto/smb/smb_dev.h                |    1 -
 sys/platform/pc32/acpica5/acpi_machdep.c  |    3 +--
 sys/platform/pc32/apm/apm.c               |    3 +--
 sys/platform/pc32/i386/elan-mmcr.c        |    5 ++---
 sys/platform/pc32/i386/perfmon.c          |    3 +--
 sys/platform/pc32/isa/asc.c               |    4 +---
 sys/platform/pc64/acpica5/acpi_machdep.c  |    3 +--
 sys/platform/pc64/apm/apm.c               |    3 +--
 sys/platform/pc64/isa/asc.c               |    4 +---
 sys/platform/vkernel/platform/console.c   |    4 +---
 sys/platform/vkernel64/platform/console.c |    4 +---
 117 files changed, 120 insertions(+), 299 deletions(-)

diff --git a/sys/bus/cam/cam_xpt.c b/sys/bus/cam/cam_xpt.c
index badb9c5..e5c8684 100644
--- a/sys/bus/cam/cam_xpt.c
+++ b/sys/bus/cam/cam_xpt.c
@@ -683,14 +683,12 @@ static struct periph_driver probe_driver =
 PERIPHDRIVER_DECLARE(xpt, xpt_driver);
 PERIPHDRIVER_DECLARE(probe, probe_driver);
 
-#define XPT_CDEV_MAJOR 104
-
 static d_open_t xptopen;
 static d_close_t xptclose;
 static d_ioctl_t xptioctl;
 
 static struct dev_ops xpt_ops = {
-	{ "xpt", XPT_CDEV_MAJOR, 0 },
+	{ "xpt", 0, 0 },
 	.d_open = xptopen,
 	.d_close = xptclose,
 	.d_ioctl = xptioctl
diff --git a/sys/bus/cam/scsi/scsi_ch.c b/sys/bus/cam/scsi/scsi_ch.c
index a32745e..798fd42 100644
--- a/sys/bus/cam/scsi/scsi_ch.c
+++ b/sys/bus/cam/scsi/scsi_ch.c
@@ -176,7 +176,6 @@ struct ch_softc {
 };
 
 #define CHUNIT(x)       (minor((x)))
-#define CH_CDEV_MAJOR	17
 
 static	d_open_t	chopen;
 static	d_close_t	chclose;
@@ -215,7 +214,7 @@ static struct periph_driver chdriver =
 PERIPHDRIVER_DECLARE(ch, chdriver);
 
 static struct dev_ops ch_ops = {
-	{ "ch", CH_CDEV_MAJOR, 0 },
+	{ "ch", 0, 0 },
 	.d_open = chopen,
 	.d_close = chclose,
 	.d_ioctl = chioctl
diff --git a/sys/bus/cam/scsi/scsi_pass.c b/sys/bus/cam/scsi/scsi_pass.c
index 23b9771..242f62e 100644
--- a/sys/bus/cam/scsi/scsi_pass.c
+++ b/sys/bus/cam/scsi/scsi_pass.c
@@ -82,8 +82,6 @@ struct pass_softc {
 	struct devstat	device_stats;
 };
 
-#define PASS_CDEV_MAJOR 31
-
 static	d_open_t	passopen;
 static	d_close_t	passclose;
 static	d_ioctl_t	passioctl;
@@ -111,7 +109,7 @@ static struct periph_driver passdriver =
 PERIPHDRIVER_DECLARE(pass, passdriver);
 
 static struct dev_ops pass_ops = {
-	{ "pass", PASS_CDEV_MAJOR, 0 },
+	{ "pass", 0, 0 },
 	.d_open =	passopen,
 	.d_close =	passclose,
 	.d_read =	noread,
diff --git a/sys/bus/cam/scsi/scsi_pt.c b/sys/bus/cam/scsi/scsi_pt.c
index 4e98e25..a3497bc 100644
--- a/sys/bus/cam/scsi/scsi_pt.c
+++ b/sys/bus/cam/scsi/scsi_pt.c
@@ -119,10 +119,8 @@ static struct periph_driver ptdriver =
 
 PERIPHDRIVER_DECLARE(pt, ptdriver);
 
-#define PT_CDEV_MAJOR 61
-
 static struct dev_ops pt_ops = {
-	{ "pt", PT_CDEV_MAJOR, 0 },
+	{ "pt", 0, 0 },
 	.d_open =	ptopen,
 	.d_close =	ptclose,
 	.d_read =	physread,
diff --git a/sys/bus/cam/scsi/scsi_sa.c b/sys/bus/cam/scsi/scsi_sa.c
index 29cbbea..130b237 100644
--- a/sys/bus/cam/scsi/scsi_sa.c
+++ b/sys/bus/cam/scsi/scsi_sa.c
@@ -427,10 +427,8 @@ PERIPHDRIVER_DECLARE(sa, sadriver);
 #define D_TAPE 0
 #endif
 
-#define SA_CDEV_MAJOR 14
-
 static struct dev_ops sa_ops = {
-	{ "sa", SA_CDEV_MAJOR, D_TAPE },
+	{ "sa", 0, D_TAPE },
 	.d_open =	saopen,
 	.d_close =	saclose,
 	.d_read =	physread,
diff --git a/sys/bus/cam/scsi/scsi_ses.c b/sys/bus/cam/scsi/scsi_ses.c
index 2a0bdf8..bbd492a 100644
--- a/sys/bus/cam/scsi/scsi_ses.c
+++ b/sys/bus/cam/scsi/scsi_ses.c
@@ -157,7 +157,6 @@ struct ses_softc {
 #define	SES_FLAG_INITIALIZED	0x04
 
 #define SESUNIT(x)       (minor((x)))
-#define SES_CDEV_MAJOR	110
 
 static	d_open_t	sesopen;
 static	d_close_t	sesclose;
@@ -180,7 +179,7 @@ static struct periph_driver sesdriver = {
 PERIPHDRIVER_DECLARE(ses, sesdriver);
 
 static struct dev_ops ses_ops = {
-	{ "ses", SES_CDEV_MAJOR, 0 }, 
+	{ "ses", 0, 0 },
 	.d_open =	sesopen,
 	.d_close =	sesclose,
 	.d_ioctl =	sesioctl,
diff --git a/sys/bus/cam/scsi/scsi_target.c b/sys/bus/cam/scsi/scsi_target.c
index eb8c210..0a4a74c 100644
--- a/sys/bus/cam/scsi/scsi_target.c
+++ b/sys/bus/cam/scsi/scsi_target.c
@@ -109,9 +109,8 @@ static struct filterops targread_filtops =
 static struct filterops targwrite_filtops =
 	{ FILTEROP_ISFD, NULL, targfiltdetach, targwritefilt };
 
-#define TARG_CDEV_MAJOR 65
 static struct dev_ops targ_ops = {
-	{ "targ", TARG_CDEV_MAJOR, 0 },
+	{ "targ", 0, 0 },
 	.d_open = targopen,
 	.d_close = targclose,
 	.d_read = targread,
diff --git a/sys/bus/firewire/fwdev.c b/sys/bus/firewire/fwdev.c
index 9363c1a..dc5e923 100644
--- a/sys/bus/firewire/fwdev.c
+++ b/sys/bus/firewire/fwdev.c
@@ -70,7 +70,6 @@
 #include <dev/firewire/iec68113.h>
 #endif
 
-#define CDEV_MAJOR 127
 #define	FWNODE_INVAL 0xffff
 
 static	d_open_t	fw_open;
@@ -88,7 +87,7 @@ static int fwfilt_write(struct knote *, long);
 
 struct dev_ops firewire_ops = 
 {
-	{ "fw", CDEV_MAJOR, D_MEM },
+	{ "fw", 0, D_MEM },
 	.d_open =	fw_open,
 	.d_close =	fw_close,
 	.d_read =	fw_read,
diff --git a/sys/bus/smbus/smb.c b/sys/bus/smbus/smb.c
index 97e0edc..44f14a9 100644
--- a/sys/bus/smbus/smb.c
+++ b/sys/bus/smbus/smb.c
@@ -88,9 +88,8 @@ static	d_open_t	smbopen;
 static	d_close_t	smbclose;
 static	d_ioctl_t	smbioctl;
 
-#define CDEV_MAJOR 106
 static struct dev_ops smb_ops = {
-	{ "smb", CDEV_MAJOR, 0 },
+	{ "smb", 0, 0 },
 	.d_open =	smbopen,
 	.d_close =	smbclose,
 	.d_ioctl =	smbioctl,
diff --git a/sys/bus/usb/usb.c b/sys/bus/usb/usb.c
index 2f6db14..f211baa 100644
--- a/sys/bus/usb/usb.c
+++ b/sys/bus/usb/usb.c
@@ -154,7 +154,7 @@ static void usbfilt_detach(struct knote *);
 static int usbfilt(struct knote *, long);
 
 static struct dev_ops usb_ops = {
-	{ "usb", USB_CDEV_MAJOR, 0 },
+	{ "usb", 0, 0 },
 	.d_open =	usbopen,
 	.d_close =	usbclose,
 	.d_read =	usbread,
diff --git a/sys/bus/usb/usbdi.h b/sys/bus/usb/usbdi.h
index d348a05..0b12cfe 100644
--- a/sys/bus/usb/usbdi.h
+++ b/sys/bus/usb/usbdi.h
@@ -93,8 +93,6 @@ typedef void (*usbd_callback)(usbd_xfer_handle, usbd_private_handle,
 #define USBD_NO_TIMEOUT 0
 #define USBD_DEFAULT_TIMEOUT 5000 /* ms = 5 s */
 
-#define USB_CDEV_MAJOR 108
-
 usbd_status usbd_open_pipe(usbd_interface_handle, u_int8_t,
 			   u_int8_t, usbd_pipe_handle *);
 usbd_status usbd_close_pipe(usbd_pipe_handle);
diff --git a/sys/dev/acpica5/acpi.c b/sys/dev/acpica5/acpi.c
index b39c2b1..8317871 100644
--- a/sys/dev/acpica5/acpi.c
+++ b/sys/dev/acpica5/acpi.c
@@ -80,9 +80,8 @@ static d_open_t		acpiopen;
 static d_close_t	acpiclose;
 static d_ioctl_t	acpiioctl;
 
-#define CDEV_MAJOR 152
 static struct dev_ops acpi_ops = {
-        { "acpi", CDEV_MAJOR, 0 },
+        { "acpi", 0, 0 },
         .d_open = acpiopen,
         .d_close = acpiclose,
         .d_ioctl = acpiioctl
diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c
index 1f284c7..54fac73 100644
--- a/sys/dev/agp/agp.c
+++ b/sys/dev/agp/agp.c
@@ -59,15 +59,13 @@ MODULE_VERSION(agp, 1);
 
 MALLOC_DEFINE(M_AGP, "agp", "AGP data structures");
 
-#define CDEV_MAJOR	148
-				/* agp_drv.c */
 static d_open_t agp_open;
 static d_close_t agp_close;
 static d_ioctl_t agp_ioctl;
 static d_mmap_t agp_mmap;
 
 static struct dev_ops agp_ops = {
-	{ "agp", CDEV_MAJOR, D_TTY },
+	{ "agp", 0, D_TTY },
 	.d_open =	agp_open,
 	.d_close =	agp_close,
 	.d_ioctl =	agp_ioctl,
diff --git a/sys/dev/disk/ahci/ahci_dragonfly.h b/sys/dev/disk/ahci/ahci_dragonfly.h
index 8545d56..56e9bb1 100644
--- a/sys/dev/disk/ahci/ahci_dragonfly.h
+++ b/sys/dev/disk/ahci/ahci_dragonfly.h
@@ -70,6 +70,4 @@
 #include <sys/thread2.h>
 #include <sys/mplock2.h>
 
-#define AHCI_CDEV_MAJOR		188
-
 #define AHCI_IRQ_RID		0
diff --git a/sys/dev/disk/ccd/ccd.c b/sys/dev/disk/ccd/ccd.c
index bea11e1..78aae9f 100644
--- a/sys/dev/disk/ccd/ccd.c
+++ b/sys/dev/disk/ccd/ccd.c
@@ -207,10 +207,8 @@ static d_dump_t ccddump;
 
 #define NCCDFREEHIWAT	16
 
-#define CDEV_MAJOR 74
-
 static struct dev_ops ccd_ops = {
-	{ "ccd", CDEV_MAJOR, D_DISK },
+	{ "ccd", 0, D_DISK },
 	.d_open =	ccdopen,
 	.d_close =	ccdclose,
 	.d_read =	physread,
diff --git a/sys/dev/disk/iscsi/initiator/iscsi.c b/sys/dev/disk/iscsi/initiator/iscsi.c
index 387b4e1..148163e 100644
--- a/sys/dev/disk/iscsi/initiator/iscsi.c
+++ b/sys/dev/disk/iscsi/initiator/iscsi.c
@@ -108,7 +108,7 @@ static d_read_t iscsi_read;
 #endif
 
 static struct dev_ops iscsi_ops = {
-     .head	= { "iscsi", ISCSI_CDEV_MAJOR, D_DISK},
+     .head	= { "iscsi", 0, D_DISK},
      .d_open	= iscsi_open,
      .d_close	= iscsi_close,
      .d_ioctl	= iscsi_ioctl,
diff --git a/sys/dev/disk/iscsi/initiator/iscsi.h b/sys/dev/disk/iscsi/initiator/iscsi.h
index ee9e4fc..c964413 100644
--- a/sys/dev/disk/iscsi/initiator/iscsi.h
+++ b/sys/dev/disk/iscsi/initiator/iscsi.h
@@ -41,8 +41,6 @@ typedef int boolean_t;
 
 #define ISCSIDEV	"iscsi"
 
-#define ISCSI_CDEV_MAJOR	115
-
 #define ISCSI_MAX_TARGETS	4 //64
 
 #define ISCSI_MAX_LUNS		4
diff --git a/sys/dev/disk/isp/isp_freebsd.c b/sys/dev/disk/isp/isp_freebsd.c
index bfdb45a..a35f7fc 100644
--- a/sys/dev/disk/isp/isp_freebsd.c
+++ b/sys/dev/disk/isp/isp_freebsd.c
@@ -43,10 +43,8 @@ static timeout_t isp_watchdog;
 static void isp_kthread(void *);
 static void isp_action(struct cam_sim *, union ccb *);
 
-
-#define ISP_CDEV_MAJOR	248
 static struct dev_ops isp_ops = {
-	{ "isp", ISP_CDEV_MAJOR, D_TAPE },
+	{ "isp", 0, D_TAPE },
 	.d_open =	nullopen,
 	.d_close =	nullclose,
 	.d_ioctl =	ispioctl,
diff --git a/sys/dev/disk/md/md.c b/sys/dev/disk/md/md.c
index 4c06382..88a9ac1 100644
--- a/sys/dev/disk/md/md.c
+++ b/sys/dev/disk/md/md.c
@@ -47,8 +47,6 @@ static u_char end_mfs_root[] __unused = "MFS Filesystem had better STOP here";
 
 static int mdrootready;
 
-#define CDEV_MAJOR	95
-
 static d_strategy_t mdstrategy;
 static d_strategy_t mdstrategy_preload;
 static d_strategy_t mdstrategy_malloc;
@@ -57,7 +55,7 @@ static d_close_t mdclose;
 static d_ioctl_t mdioctl;
 
 static struct dev_ops md_ops = {
-	{ "md", CDEV_MAJOR, D_DISK | D_CANFREE | D_MEMDISK | D_TRACKCLOSE},
+	{ "md", 0, D_DISK | D_CANFREE | D_MEMDISK | D_TRACKCLOSE},
         .d_open =	mdopen,
         .d_close =	mdclose,
         .d_read =	physread,
diff --git a/sys/dev/disk/sili/sili_dragonfly.h b/sys/dev/disk/sili/sili_dragonfly.h
index 30a6880..9a4f2c9 100644
--- a/sys/dev/disk/sili/sili_dragonfly.h
+++ b/sys/dev/disk/sili/sili_dragonfly.h
@@ -70,6 +70,4 @@
 #include <sys/thread2.h>
 #include <sys/mplock2.h>
 
-#define SILI_CDEV_MAJOR		188
-
 #define SILI_IRQ_RID		0
diff --git a/sys/dev/disk/vn/vn.c b/sys/dev/disk/vn/vn.c
index 4cf0a19..b99814f 100644
--- a/sys/dev/disk/vn/vn.c
+++ b/sys/dev/disk/vn/vn.c
@@ -101,8 +101,6 @@ DEVFS_DECLARE_CLONE_BITMAP(vn);
 #define VN_PREALLOCATED_UNITS	NVN
 #endif
 
-#define CDEV_MAJOR 43
-
 #define VN_BSIZE_BEST	8192
 
 /*
@@ -112,7 +110,7 @@ DEVFS_DECLARE_CLONE_BITMAP(vn);
  */
 
 static struct dev_ops vn_ops = {
-	{ "vn", CDEV_MAJOR, D_DISK | D_CANFREE },
+	{ "vn", 0, D_DISK | D_CANFREE },
 	.d_open =	vnopen,
 	.d_close =	vnclose,
 	.d_read =	physread,
diff --git a/sys/dev/disk/wt/wt.c b/sys/dev/disk/wt/wt.c
index b989599..ad21b60 100644
--- a/sys/dev/disk/wt/wt.c
+++ b/sys/dev/disk/wt/wt.c
@@ -183,10 +183,8 @@ static	d_close_t	wtclose;
 static	d_ioctl_t	wtioctl;
 static	d_strategy_t	wtstrategy;
 
-#define CDEV_MAJOR 10
-
 static struct dev_ops wt_ops = {
-	{ "wt", CDEV_MAJOR, 0 },
+	{ "wt", 0, 0 },
 	.d_open =	wtopen,
 	.d_close =	wtclose,
 	.d_read =	physread,
diff --git a/sys/dev/drm/drm.h b/sys/dev/drm/drm.h
index d4e8c90..942a9ae 100644
--- a/sys/dev/drm/drm.h
+++ b/sys/dev/drm/drm.h
@@ -95,7 +95,6 @@
 #if defined(__linux__) || defined(__NetBSD__)
 #define DRM_MAJOR       226
 #endif
-#define DRM_MAX_MINOR   15
 
 #define DRM_NAME	"drm"	  /**< Name in kernel, /dev, and /proc */
 #define DRM_MIN_ORDER	5	  /**< At least 2^5 bytes = 32 bytes */
diff --git a/sys/dev/misc/cmx/cmx.c b/sys/dev/misc/cmx/cmx.c
index 0d5c9fd..1d05dce 100644
--- a/sys/dev/misc/cmx/cmx.c
+++ b/sys/dev/misc/cmx/cmx.c
@@ -138,9 +138,8 @@ static void cmx_filter_detach(struct knote *);
 static int cmx_filter_read(struct knote *, long);
 static int cmx_filter_write(struct knote *, long);
 
-#define CDEV_MAJOR	185
 static struct dev_ops cmx_ops = {
-	{ "cmx", CDEV_MAJOR, 0 },
+	{ "cmx", 0, 0 },
 	.d_open =	cmx_open,
 	.d_close =	cmx_close,
 	.d_read =	cmx_read,
diff --git a/sys/dev/misc/dcons/dcons_os.c b/sys/dev/misc/dcons/dcons_os.c
index 55304c9..b72b4a3 100644
--- a/sys/dev/misc/dcons/dcons_os.c
+++ b/sys/dev/misc/dcons/dcons_os.c
@@ -89,14 +89,12 @@
 #define DCONS_FORCE_GDB	1
 #endif
 
-#define CDEV_MAJOR      184
-
 static d_open_t		dcons_open;
 static d_close_t	dcons_close;
 static d_ioctl_t	dcons_ioctl;
 
 static struct dev_ops dcons_ops = {
-	{ "dcons", CDEV_MAJOR, D_TTY },
+	{ "dcons", 0, D_TTY },
 	.d_open =	dcons_open,
 	.d_close =	dcons_close,
 	.d_read =	ttyread,
diff --git a/sys/dev/misc/gpib/gpib.c b/sys/dev/misc/gpib/gpib.c
index b3149f7..fee834f 100644
--- a/sys/dev/misc/gpib/gpib.c
+++ b/sys/dev/misc/gpib/gpib.c
@@ -64,9 +64,8 @@ static	d_close_t	gpclose;
 static	d_write_t	gpwrite;
 static	d_ioctl_t	gpioctl;
 
-#define CDEV_MAJOR 44
 static struct dev_ops gp_ops = {
-	{ "gp", CDEV_MAJOR, 0 },
+	{ "gp", 0, 0 },
 	.d_open =	gpopen,
 	.d_close =	gpclose,
 	.d_write =	gpwrite,
diff --git a/sys/dev/misc/hotplug/hotplug.c b/sys/dev/misc/hotplug/hotplug.c
index fae5d79..a1f9e37 100644
--- a/sys/dev/misc/hotplug/hotplug.c
+++ b/sys/dev/misc/hotplug/hotplug.c
@@ -35,8 +35,6 @@
 
 #define HOTPLUG_MAXEVENTS	16
 
-#define CDEV_MAJOR		82
-
 static d_open_t		hotplugopen;
 static d_close_t	hotplugclose;
 static d_read_t		hotplugread;
@@ -46,7 +44,7 @@ static void hotplugfiltdetach(struct knote *);
 static int hotplugfilt(struct knote *, long);
 
 static struct dev_ops hotplug_ops = {
-	{ "hotplug", CDEV_MAJOR, 0 },
+	{ "hotplug", 0, 0 },
 	.d_open =	hotplugopen,
 	.d_close =	hotplugclose,
 	.d_read =	hotplugread,
diff --git a/sys/dev/misc/joy/joy.c b/sys/dev/misc/joy/joy.c
index 583aa32..6da536f 100644
--- a/sys/dev/misc/joy/joy.c
+++ b/sys/dev/misc/joy/joy.c
@@ -74,14 +74,13 @@ struct joy_softc {
 static int joy_probe (device_t);
 static int joy_attach (device_t);
 
-#define CDEV_MAJOR 51
 static	d_open_t	joyopen;
 static	d_close_t	joyclose;
 static	d_read_t	joyread;
 static	d_ioctl_t	joyioctl;
 
 static struct dev_ops joy_ops = {
-	{ "joy", CDEV_MAJOR, 0 },
+	{ "joy", 0, 0 },
 	.d_open =	joyopen,
 	.d_close =	joyclose,
 	.d_read =	joyread,
diff --git a/sys/dev/misc/kbd/kbd.c b/sys/dev/misc/kbd/kbd.c
index f900119..ab74ff8 100644
--- a/sys/dev/misc/kbd/kbd.c
+++ b/sys/dev/misc/kbd/kbd.c
@@ -581,10 +581,8 @@ static d_kqfilter_t	genkbdkqfilter;
 static void genkbdfiltdetach(struct knote *);
 static int genkbdfilter(struct knote *, long);
 
-#define CDEV_MAJOR	112
-
 static struct dev_ops kbd_ops = {
-	{ "kbd", CDEV_MAJOR, 0 },
+	{ "kbd", 0, 0 },
 	.d_open =	genkbdopen,
 	.d_close =	genkbdclose,
 	.d_read =	genkbdread,
diff --git a/sys/dev/misc/labpc/labpc.c b/sys/dev/misc/labpc/labpc.c
index b27247f..4fdf4f8 100644
--- a/sys/dev/misc/labpc/labpc.c
+++ b/sys/dev/misc/labpc/labpc.c
@@ -289,9 +289,8 @@ static	d_close_t	labpcclose;
 static	d_ioctl_t	labpcioctl;
 static	d_strategy_t	labpcstrategy;
 
-#define CDEV_MAJOR 66
 static struct dev_ops labpc_ops = {
-	{ "labpc", CDEV_MAJOR, 0 },
+	{ "labpc", 0, 0 },
 	.d_open =	labpcopen,
 	.d_close =	labpcclose,
 	.d_read =	physread,
diff --git a/sys/dev/misc/lpt/lpt.c b/sys/dev/misc/lpt/lpt.c
index 7bc72dc..01fb639 100644
--- a/sys/dev/misc/lpt/lpt.c
+++ b/sys/dev/misc/lpt/lpt.c
@@ -190,9 +190,8 @@ static	d_write_t	lptwrite;
 static	d_read_t	lptread;
 static	d_ioctl_t	lptioctl;
 
-#define CDEV_MAJOR 16
 static struct dev_ops lpt_ops = {
-	{ LPT_NAME, CDEV_MAJOR, 0 },
+	{ LPT_NAME, 0, 0 },
 	.d_open =	lptopen,
 	.d_close =	lptclose,
 	.d_read =	lptread,
diff --git a/sys/dev/misc/mse/mse.c b/sys/dev/misc/mse/mse.c
index abd5c2d..15968a7 100644
--- a/sys/dev/misc/mse/mse.c
+++ b/sys/dev/misc/mse/mse.c
@@ -138,9 +138,8 @@ static	d_kqfilter_t	msekqfilter;
 static void msefilter_detach(struct knote *);
 static int msefilter(struct knote *, long);
 
-#define CDEV_MAJOR 27
 static struct dev_ops mse_ops = {
-	{ "mse", CDEV_MAJOR, 0 },
+	{ "mse", 0, 0 },
 	.d_open =	mseopen,
 	.d_close =	mseclose,
 	.d_read =	mseread,
diff --git a/sys/dev/misc/nmdm/nmdm.c b/sys/dev/misc/nmdm/nmdm.c
index 42ba14d..0a60db4 100644
--- a/sys/dev/misc/nmdm/nmdm.c
+++ b/sys/dev/misc/nmdm/nmdm.c
@@ -74,9 +74,8 @@ static	d_read_t	nmdmread;
 static	d_write_t	nmdmwrite;
 static	d_ioctl_t	nmdmioctl;
 
-#define	CDEV_MAJOR	18
 static struct dev_ops nmdm_ops = {
-	{ "pts", CDEV_MAJOR, D_TTY },
+	{ "pts", 0, D_TTY },
 	.d_open =	nmdmopen,
 	.d_close =	nmdmclose,
 	.d_read =	nmdmread,
@@ -608,4 +607,4 @@ nmdm_drvinit(void *unused)
 	lwkt_reltoken(&tty_token);
 }
 
-SYSINIT(nmdmdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,nmdm_drvinit,NULL)
+SYSINIT(nmdmdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,nmdm_drvinit,NULL)
diff --git a/sys/dev/misc/pcfclock/pcfclock.c b/sys/dev/misc/pcfclock/pcfclock.c
index 190658a..9d88d82 100644
--- a/sys/dev/misc/pcfclock/pcfclock.c
+++ b/sys/dev/misc/pcfclock/pcfclock.c
@@ -67,9 +67,8 @@ static	d_open_t		pcfclock_open;
 static	d_close_t		pcfclock_close;
 static	d_read_t		pcfclock_read;
 
-#define CDEV_MAJOR 140
 static struct dev_ops pcfclock_ops = {
-	{ PCFCLOCK_NAME, CDEV_MAJOR, 0 },
+	{ PCFCLOCK_NAME, 0, 0 },
 	.d_open =	pcfclock_open,
 	.d_close =	pcfclock_close,
 	.d_read =	pcfclock_read,
diff --git a/sys/dev/misc/ppi/ppi.c b/sys/dev/misc/ppi/ppi.c
index dcb40a5..5f340e6 100644
--- a/sys/dev/misc/ppi/ppi.c
+++ b/sys/dev/misc/ppi/ppi.c
@@ -89,9 +89,8 @@ static	d_ioctl_t	ppiioctl;
 static	d_write_t	ppiwrite;
 static	d_read_t	ppiread;
 
-#define CDEV_MAJOR 82
 static struct dev_ops ppi_ops = {
-	{ "ppi", CDEV_MAJOR, 0 },
+	{ "ppi", 0, 0 },
 	.d_open =	ppiopen,
 	.d_close =	ppiclose,
 	.d_read =	ppiread,
diff --git a/sys/dev/misc/pps/pps.c b/sys/dev/misc/pps/pps.c
index 190e60d..ebdabf0 100644
--- a/sys/dev/misc/pps/pps.c
+++ b/sys/dev/misc/pps/pps.c
@@ -59,9 +59,8 @@ static	d_open_t	ppsopen;
 static	d_close_t	ppsclose;
 static	d_ioctl_t	ppsioctl;
 
-#define CDEV_MAJOR 89
 static struct dev_ops pps_ops = {
-	{ PPS_NAME, CDEV_MAJOR, 0 },
+	{ PPS_NAME, 0, 0 },
 	.d_open =	ppsopen,
 	.d_close =	ppsclose,
 	.d_ioctl =	ppsioctl,
diff --git a/sys/dev/misc/psm/psm.c b/sys/dev/misc/psm/psm.c
index 4a6ede1..a8e9e40 100644
--- a/sys/dev/misc/psm/psm.c
+++ b/sys/dev/misc/psm/psm.c
@@ -340,10 +340,8 @@ static struct isa_pnp_id psm_ids[] = {
 };
 #endif
 
-#define CDEV_MAJOR        21
-
 static struct dev_ops psm_ops = {
-	{ PSM_DRIVER_NAME, CDEV_MAJOR, 0 },
+	{ PSM_DRIVER_NAME, 0, 0 },
 	.d_open =	psmopen,
 	.d_close =	psmclose,
 	.d_read =	psmread,
diff --git a/sys/dev/misc/snp/snp.c b/sys/dev/misc/snp/snp.c
index 28e53c9..2e2376b 100644
--- a/sys/dev/misc/snp/snp.c
+++ b/sys/dev/misc/snp/snp.c
@@ -55,9 +55,8 @@ static int snpfilter_wr(struct knote *, long);
 #define SNP_PREALLOCATED_UNITS	NSNP
 #endif
 
-#define CDEV_MAJOR 53
 static struct dev_ops snp_ops = {
-	{ "snp", CDEV_MAJOR, 0 },
+	{ "snp", 0, 0 },
 	.d_open =	snpopen,
 	.d_close =	snpclose,
 	.d_read =	snpread,
@@ -739,4 +738,4 @@ static moduledata_t snp_mod = {
         snp_modevent,
         NULL
 };
-DECLARE_MODULE(snp, snp_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE + CDEV_MAJOR);
+DECLARE_MODULE(snp, snp_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
diff --git a/sys/dev/misc/spic/spic.c b/sys/dev/misc/spic/spic.c
index dba3b9c..ff50178 100644
--- a/sys/dev/misc/spic/spic.c
+++ b/sys/dev/misc/spic/spic.c
@@ -91,7 +91,7 @@ static void spicfilt_detach(struct knote *);
 static int spicfilt(struct knote *, long);
 
 static struct dev_ops spic_ops = {
-	{ "spic", CDEV_MAJOR, 0 },
+	{ "spic", 0, 0 },
         .d_open =	spicopen,
         .d_close =	spicclose,
         .d_read =	spicread,
diff --git a/sys/dev/misc/spic/spicreg.h b/sys/dev/misc/spic/spicreg.h
index 6832ba5..fe7d2cb 100644
--- a/sys/dev/misc/spic/spicreg.h
+++ b/sys/dev/misc/spic/spicreg.h
@@ -28,8 +28,6 @@
  *
  */
 
-#define CDEV_MAJOR	160
-
 /*
  * Find the PCI device that holds the G10 register needed to map in the SPIC
  */
diff --git a/sys/dev/misc/spigot/spigot.c b/sys/dev/misc/spigot/spigot.c
index 6fd953a..3fece22 100644
--- a/sys/dev/misc/spigot/spigot.c
+++ b/sys/dev/misc/spigot/spigot.c
@@ -97,9 +97,8 @@ static	d_write_t	spigot_write;
 static	d_ioctl_t	spigot_ioctl;
 static	d_mmap_t	spigot_mmap;
 
-#define CDEV_MAJOR 11
 static struct dev_ops spigot_ops = {
-	{ "spigot", CDEV_MAJOR, 0 },
+	{ "spigot", 0, 0 },
 	.d_open =	spigot_open,
 	.d_close =	spigot_close,
 	.d_read =	spigot_read,
diff --git a/sys/dev/misc/syscons/syscons.c b/sys/dev/misc/syscons/syscons.c
index f918559..e6c072f 100644
--- a/sys/dev/misc/syscons/syscons.c
+++ b/sys/dev/misc/syscons/syscons.c
@@ -213,8 +213,6 @@ syscons_unlock(void)
 /*
  * Console driver
  */
-#define	CDEV_MAJOR	12
-
 static cn_probe_t	sccnprobe;
 static cn_init_t	sccninit;
 static cn_init_t	sccninit_fini;
@@ -234,7 +232,7 @@ static	d_ioctl_t	scioctl;
 static	d_mmap_t	scmmap;
 
 static struct dev_ops sc_ops = {
-	{ "sc", CDEV_MAJOR, D_TTY },
+	{ "sc", 0, D_TTY },
 	.d_open =	scopen,
 	.d_close =	scclose,
 	.d_read =	scread,
diff --git a/sys/dev/misc/syscons/sysmouse.c b/sys/dev/misc/syscons/sysmouse.c
index 52cbfcf..f2ce10d 100644
--- a/sys/dev/misc/syscons/sysmouse.c
+++ b/sys/dev/misc/syscons/sysmouse.c
@@ -51,7 +51,6 @@
 
 #ifndef SC_NO_SYSMOUSE
 
-#define	CDEV_MAJOR	12		/* major number, shared with syscons */
 #define SC_MOUSE 	128		/* minor number */
 
 static d_open_t		smopen;
@@ -59,7 +58,7 @@ static d_close_t	smclose;
 static d_ioctl_t	smioctl;
 
 static struct dev_ops sm_ops = {
-	{ "sysmouse", CDEV_MAJOR, D_TTY },
+	{ "sysmouse", 0, D_TTY },
 	.d_open =	smopen,
 	.d_close =	smclose,
 	.d_read =	ttyread,
@@ -292,8 +291,7 @@ sm_attach_mouse(void *unused)
 	/* sysmouse doesn't have scr_stat */
 }
 
-SYSINIT(sysmouse, SI_SUB_DRIVERS, SI_ORDER_MIDDLE + CDEV_MAJOR,
-	sm_attach_mouse, NULL)
+SYSINIT(sysmouse, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, sm_attach_mouse, NULL)
 
 int
 sysmouse_event(mouse_info_t *info)
diff --git a/sys/dev/misc/tw/tw.c b/sys/dev/misc/tw/tw.c
index ac2e31c..a652140 100644
--- a/sys/dev/misc/tw/tw.c
+++ b/sys/dev/misc/tw/tw.c
@@ -219,9 +219,8 @@ static void twfilter_detach(struct knote *);
 static int twfilter_read(struct knote *, long);
 static int twfilter_write(struct knote *, long);
 
-#define CDEV_MAJOR 19
 static struct dev_ops tw_ops = {
-	{ "tw", CDEV_MAJOR, 0 },
+	{ "tw", 0, 0 },
 	.d_open	=	twopen,
 	.d_close =	twclose,
 	.d_read =	twread,
diff --git a/sys/dev/raid/aac/aac.c b/sys/dev/raid/aac/aac.c
index cd940b3..30174ff 100644
--- a/sys/dev/raid/aac/aac.c
+++ b/sys/dev/raid/aac/aac.c
@@ -225,11 +225,8 @@ static int		aac_query_disk(struct aac_softc *sc, caddr_t uptr);
 static int		aac_get_pci_info(struct aac_softc *sc, caddr_t uptr);
 static void		aac_ioctl_event(struct aac_softc *sc,
 				        struct aac_event *event, void *arg);
-
-#define AAC_CDEV_MAJOR	150
-
 static struct dev_ops aac_ops = {
-	{ "aac", AAC_CDEV_MAJOR, 0 },
+	{ "aac", 0, 0 },
 	.d_open =	aac_open,
 	.d_close =	aac_close,
 	.d_ioctl =	aac_ioctl,
diff --git a/sys/dev/raid/aac/aacvar.h b/sys/dev/raid/aac/aacvar.h
index 8995c3c..ccb8c6b 100644
--- a/sys/dev/raid/aac/aacvar.h
+++ b/sys/dev/raid/aac/aacvar.h
@@ -93,11 +93,6 @@
 #define AAC_PERIODIC_INTERVAL	20		/* seconds */
 
 /*
- * Character device major numbers.
- */
-#define AAC_DISK_MAJOR	200
-
-/*
  * Per-container data structure
  */
 struct aac_container
diff --git a/sys/dev/raid/amr/amr.c b/sys/dev/raid/amr/amr.c
index 17bf79e..bed30f9 100644
--- a/sys/dev/raid/amr/amr.c
+++ b/sys/dev/raid/amr/amr.c
@@ -82,14 +82,12 @@
 #define AMR_DEFINE_TABLES
 #include "amr_tables.h"
 
-#define AMR_CDEV_MAJOR	132
-
 static d_open_t         amr_open;
 static d_close_t        amr_close;
 static d_ioctl_t        amr_ioctl;
 
 static struct dev_ops amr_ops = {
-	{ "amr", AMR_CDEV_MAJOR, 0 },
+	{ "amr", 0, 0 },
 	.d_open =	amr_open,
 	.d_close =	amr_close,
 	.d_ioctl =	amr_ioctl
diff --git a/sys/dev/raid/amr/amr_disk.c b/sys/dev/raid/amr/amr_disk.c
index 96bec12..abe2b07 100644
--- a/sys/dev/raid/amr/amr_disk.c
+++ b/sys/dev/raid/amr/amr_disk.c
@@ -94,10 +94,8 @@ static	d_strategy_t	amrd_strategy;
 static	d_ioctl_t	amrd_ioctl;
 static	d_dump_t	amrd_dump;
 
-#define AMRD_CDEV_MAJOR	133
-
 static struct dev_ops amrd_ops = {
-	{ "amrd", AMRD_CDEV_MAJOR, D_DISK },
+	{ "amrd", 0, D_DISK },
 	.d_open = amrd_open,
 	.d_close = amrd_close,
 	.d_read = physread,
diff --git a/sys/dev/raid/ciss/ciss.c b/sys/dev/raid/ciss/ciss.c
index f3bc584..4e4c35c 100644
--- a/sys/dev/raid/ciss/ciss.c
+++ b/sys/dev/raid/ciss/ciss.c
@@ -230,10 +230,8 @@ static d_open_t		ciss_open;
 static d_close_t	ciss_close;
 static d_ioctl_t	ciss_ioctl;
 
-#define CISS_CDEV_MAJOR  166
-
 static struct dev_ops ciss_ops = {
-    { "ciss", CISS_CDEV_MAJOR, 0 },
+    { "ciss", 0, 0 },
     .d_open =		ciss_open,
     .d_close =		ciss_close,
     .d_ioctl =		ciss_ioctl
diff --git a/sys/dev/raid/dpt/dpt.h b/sys/dev/raid/dpt/dpt.h
index 251c470..280618f 100644
--- a/sys/dev/raid/dpt/dpt.h
+++ b/sys/dev/raid/dpt/dpt.h
@@ -48,8 +48,6 @@
 
 #include <sys/ioccom.h>
 
-#define DPT_CDEV_MAJOR 88
-
 #undef DPT_USE_DLM_SWI
 
 extern u_long dpt_unit;
diff --git a/sys/dev/raid/ida/ida_disk.c b/sys/dev/raid/ida/ida_disk.c
index 9a01d58..f9cd89b 100644
--- a/sys/dev/raid/ida/ida_disk.c
+++ b/sys/dev/raid/ida/ida_disk.c
@@ -65,11 +65,8 @@ static	d_close_t	idad_close;
 static	d_strategy_t	idad_strategy;
 static	d_dump_t	idad_dump;
 
-#define IDAD_BDEV_MAJOR	29
-#define IDAD_CDEV_MAJOR	109
-
 static struct dev_ops id_ops = {
-	{ "idad", IDAD_CDEV_MAJOR, D_DISK },
+	{ "idad", 0, D_DISK },
 	.d_open =	idad_open,
 	.d_close =	idad_close,
 	.d_read =	physread,
diff --git a/sys/dev/raid/iir/iir.h b/sys/dev/raid/iir/iir.h
index bb2629d..c902738 100644
--- a/sys/dev/raid/iir/iir.h
+++ b/sys/dev/raid/iir/iir.h
@@ -53,8 +53,6 @@
 #define IIR_DRIVER_VERSION      1
 #define IIR_DRIVER_SUBVERSION   5
 
-#define IIR_CDEV_MAJOR          164
-
 /* OEM IDs */
 #define OEM_ID_ICP              0x941c
 #define OEM_ID_INTEL            0x8000
diff --git a/sys/dev/raid/iir/iir_ctrl.c b/sys/dev/raid/iir/iir_ctrl.c
index 2d06e71..0d5cc3b 100644
--- a/sys/dev/raid/iir/iir_ctrl.c
+++ b/sys/dev/raid/iir/iir_ctrl.c
@@ -69,11 +69,8 @@ static d_write_t	iir_write;
 static d_read_t		iir_read;
 static d_ioctl_t	iir_ioctl;
 
-#define CDEV_MAJOR          IIR_CDEV_MAJOR
-
-/* Normally, this is a static structure.  But we need it in pci/iir_pci.c */
 static struct dev_ops iir_ops = {
-	{ "iir", CDEV_MAJOR, 0 },
+	{ "iir", 0, 0 },
         .d_open =	iir_open,
         .d_close =	iir_close,
         .d_read =	iir_read,
diff --git a/sys/dev/raid/ips/ips.c b/sys/dev/raid/ips/ips.c
index 4dacc3d..8a3f8b0 100644
--- a/sys/dev/raid/ips/ips.c
+++ b/sys/dev/raid/ips/ips.c
@@ -42,7 +42,7 @@ static d_ioctl_t ips_ioctl;
 MALLOC_DEFINE(M_IPSBUF, "ipsbuf", "IPS driver buffer");
 
 static struct dev_ops ips_ops = {
-	{ "ips", IPS_CDEV_MAJOR, D_DISK },
+	{ "ips", 0, D_DISK },
 	.d_open	= 	ips_open,
 	.d_close =	ips_close,
 	.d_ioctl =	ips_ioctl,
diff --git a/sys/dev/raid/ips/ips.h b/sys/dev/raid/ips/ips.h
index 2784e17..6d612c7 100644
--- a/sys/dev/raid/ips/ips.h
+++ b/sys/dev/raid/ips/ips.h
@@ -481,6 +481,3 @@ extern void ips_copperhead_intr(void *sc);
 extern void ips_issue_copperhead_cmd(ips_command_t *command);
 extern void ips_copperhead_poll(ips_command_t *command);
 int ips_timed_wait(ips_command_t *, const char *, int);
-
-#define IPS_CDEV_MAJOR 175
-#define IPSD_CDEV_MAJOR 176
diff --git a/sys/dev/raid/ips/ips_disk.c b/sys/dev/raid/ips/ips_disk.c
index 68268fc..0b367ac 100644
--- a/sys/dev/raid/ips/ips_disk.c
+++ b/sys/dev/raid/ips/ips_disk.c
@@ -52,7 +52,7 @@ static d_strategy_t ipsd_strategy;
 static d_dump_t ipsd_dump;
 
 static struct dev_ops ipsd_ops = {
-	{ "ipsd", IPSD_CDEV_MAJOR, D_DISK },
+	{ "ipsd", 0, D_DISK },
 	.d_open	=	ipsd_open,
 	.d_close =	ipsd_close,
 	.d_strategy =	ipsd_strategy,
diff --git a/sys/dev/raid/mlx/mlx.c b/sys/dev/raid/mlx/mlx.c
index d9af989..d34ea07 100644
--- a/sys/dev/raid/mlx/mlx.c
+++ b/sys/dev/raid/mlx/mlx.c
@@ -50,10 +50,8 @@
 #include "mlxvar.h"
 #include "mlxreg.h"
 
-#define MLX_CDEV_MAJOR	130
-
 static struct dev_ops mlx_ops = {
-	{ "mlx", MLX_CDEV_MAJOR, 0 },
+	{ "mlx", 0, 0 },
 	.d_open =	mlx_open,
 	.d_close =	mlx_close,
 	.d_ioctl =	mlx_ioctl,
diff --git a/sys/dev/raid/mlx/mlx_disk.c b/sys/dev/raid/mlx/mlx_disk.c
index 6b41a55..fb6743b 100644
--- a/sys/dev/raid/mlx/mlx_disk.c
+++ b/sys/dev/raid/mlx/mlx_disk.c
@@ -57,10 +57,8 @@ static	d_close_t	mlxd_close;
 static	d_strategy_t	mlxd_strategy;
 static	d_ioctl_t	mlxd_ioctl;
 
-#define MLXD_CDEV_MAJOR	131
-
 static struct dev_ops mlxd_ops = {
-		{ "mlxd", MLXD_CDEV_MAJOR, D_DISK },
+		{ "mlxd", 0, D_DISK },
 		.d_open =	mlxd_open,
 		.d_close =	mlxd_close,
 		.d_read =	physread,
diff --git a/sys/dev/raid/mly/mly.c b/sys/dev/raid/mly/mly.c
index 5883830..0fe0a86 100644
--- a/sys/dev/raid/mly/mly.c
+++ b/sys/dev/raid/mly/mly.c
@@ -147,10 +147,8 @@ static driver_t mly_pci_driver = {
 static devclass_t	mly_devclass;
 DRIVER_MODULE(mly, pci, mly_pci_driver, mly_devclass, 0, 0);
 
-#define MLY_CDEV_MAJOR  158
-
 static struct dev_ops mly_ops = {
-    { "mly", MLY_CDEV_MAJOR, 0 },
+    { "mly", 0, 0 },
     .d_open =	mly_user_open,
     .d_close =	mly_user_close,
     .d_ioctl =	mly_user_ioctl,
diff --git a/sys/dev/raid/twe/twe_freebsd.c b/sys/dev/raid/twe/twe_freebsd.c
index 36f5f00..1c368e8 100644
--- a/sys/dev/raid/twe/twe_freebsd.c
+++ b/sys/dev/raid/twe/twe_freebsd.c
@@ -64,7 +64,7 @@ static	d_close_t		twe_close;
 static	d_ioctl_t		twe_ioctl_wrapper;
 
 static struct dev_ops twe_ops = {
-	{ "twe", TWE_CDEV_MAJOR, 0 },
+	{ "twe", 0, 0 },
 	.d_open =	twe_open,
 	.d_close =	twe_close,
 	.d_ioctl =	twe_ioctl_wrapper,
@@ -607,7 +607,7 @@ static	d_strategy_t	twed_strategy;
 static	d_dump_t	twed_dump;
 
 static struct dev_ops twed_ops = {
-	{ "twed", TWED_CDEV_MAJOR, D_DISK },
+	{ "twed", 0, D_DISK },
 	.d_open =	twed_open,
 	.d_close =	twed_close,
 	.d_read =	physread,
diff --git a/sys/dev/raid/twe/twevar.h b/sys/dev/raid/twe/twevar.h
index 671b4a3..b8a7e5a 100644
--- a/sys/dev/raid/twe/twevar.h
+++ b/sys/dev/raid/twe/twevar.h
@@ -31,9 +31,6 @@
  */
 
 #define TWE_DRIVER_VERSION_STRING	"1.40.01.002"
-#define TWE_CDEV_MAJOR			146
-#define TWED_CDEV_MAJOR			147
-
 
 #ifdef TWE_DEBUG
 #define debug(level, fmt, args...)							\
diff --git a/sys/dev/serial/cy/cy.c b/sys/dev/serial/cy/cy.c
index a78773c..fca2866 100644
--- a/sys/dev/serial/cy/cy.c
+++ b/sys/dev/serial/cy/cy.c
@@ -384,9 +384,8 @@ static	d_close_t	sioclose;
 static	d_write_t	siowrite;
 static	d_ioctl_t	sioioctl;
 
-#define	CDEV_MAJOR	48
 static struct dev_ops sio_ops = {
-	{ driver_name, CDEV_MAJOR, D_TTY },
+	{ driver_name, 0, D_TTY },
 	.d_open =	sioopen,
 	.d_close =	sioclose,
 	.d_read =	ttyread,
diff --git a/sys/dev/serial/dgb/dgm.c b/sys/dev/serial/dgb/dgm.c
index 90e8dfc..e826155 100644
--- a/sys/dev/serial/dgb/dgm.c
+++ b/sys/dev/serial/dgb/dgm.c
@@ -240,9 +240,8 @@ static driver_t dgmdriver = {
 
 static devclass_t dgmdevclass;
 
-#define	CDEV_MAJOR	101
 static struct dev_ops dgm_ops = {
-	{ "dgm", CDEV_MAJOR, D_TTY },
+	{ "dgm", 0, D_TTY },
 	.d_open =	dgmopen,
 	.d_close =	dgmclose,
 	.d_read =	ttyread,
diff --git a/sys/dev/serial/digi/digi.c b/sys/dev/serial/digi/digi.c
index eac99ce..e042be3 100644
--- a/sys/dev/serial/digi/digi.c
+++ b/sys/dev/serial/digi/digi.c
@@ -65,8 +65,6 @@
 #include <dev/serial/digi/digi_pci.h>
 #include <dev/serial/digi/digi_bios.h>
 
-#define	CDEV_MAJOR	162
-
 #define	CTRL_DEV		0x800000
 #define	CALLOUT_MASK		0x400000
 #define	CONTROL_INIT_STATE	0x100000
@@ -149,7 +147,7 @@ const struct digi_control_signals digi_normal_signals = {
 };
 
 static struct dev_ops digi_ops = {
-	{ "dgm", CDEV_MAJOR, D_TTY },
+	{ "dgm", 0, D_TTY },
 	.d_open =	digiopen,
 	.d_close =	digiclose,
 	.d_read =	digiread,
diff --git a/sys/dev/serial/rc/rc.c b/sys/dev/serial/rc/rc.c
index 3bdfdcd..445c32e 100644
--- a/sys/dev/serial/rc/rc.c
+++ b/sys/dev/serial/rc/rc.c
@@ -92,9 +92,8 @@ static	d_open_t	rcopen;
 static	d_close_t	rcclose;
 static	d_ioctl_t	rcioctl;
 
-#define	CDEV_MAJOR	63
 static struct dev_ops rc_ops = {
-	{ "rc", CDEV_MAJOR, D_TTY },
+	{ "rc", 0, D_TTY },
 	.d_open =	rcopen,
 	.d_close =	rcclose,
 	.d_read =	ttyread,
diff --git a/sys/dev/serial/rp/rp.c b/sys/dev/serial/rp/rp.c
index e888479..556fe98 100644
--- a/sys/dev/serial/rp/rp.c
+++ b/sys/dev/serial/rp/rp.c
@@ -590,9 +590,8 @@ static	d_close_t	rpclose;
 static	d_write_t	rpwrite;
 static	d_ioctl_t	rpioctl;
 
-#define	CDEV_MAJOR	81
 static struct dev_ops rp_ops = {
-	{ "rp", CDEV_MAJOR, D_TTY },
+	{ "rp", 0, D_TTY },
 	.d_open =	rpopen,
 	.d_close =	rpclose,
 	.d_read =	ttyread,
diff --git a/sys/dev/serial/si/si.c b/sys/dev/serial/si/si.c
index 3c34b30..191a908 100644
--- a/sys/dev/serial/si/si.c
+++ b/sys/dev/serial/si/si.c
@@ -120,9 +120,8 @@ static	d_close_t	siclose;
 static	d_write_t	siwrite;
 static	d_ioctl_t	siioctl;
 
-#define	CDEV_MAJOR	68
 static struct dev_ops si_ops = {
-	{ "si", CDEV_MAJOR, D_TTY },
+	{ "si", 0, D_TTY },
 	.d_open =	siopen,
 	.d_close =	siclose,
 	.d_read =	ttyread,
diff --git a/sys/dev/serial/sio/sio.c b/sys/dev/serial/sio/sio.c
index 085d830..f27f8ae 100644
--- a/sys/dev/serial/sio/sio.c
+++ b/sys/dev/serial/sio/sio.c
@@ -251,9 +251,8 @@ static	d_read_t	sioread;
 static	d_write_t	siowrite;
 static	d_ioctl_t	sioioctl;
 
-#define	CDEV_MAJOR	28
 static struct dev_ops sio_ops = {
-	{ driver_name, CDEV_MAJOR, D_TTY },
+	{ driver_name, 0, D_TTY },
 	.d_open =	sioopen,
 	.d_close =	sioclose,
 	.d_read =	sioread,
diff --git a/sys/dev/serial/stl/stallion.c b/sys/dev/serial/stl/stallion.c
index 0c27445..dd990f9 100644
--- a/sys/dev/serial/stl/stallion.c
+++ b/sys/dev/serial/stl/stallion.c
@@ -748,9 +748,8 @@ COMPAT_PCI_DRIVER (stlpci, stlpcidriver);
  *	FreeBSD-2.2+ kernel linkage.
  */
 
-#define	CDEV_MAJOR	72
 static struct dev_ops stl_ops = {
-	{ "stl", CDEV_MAJOR, D_TTY },
+	{ "stl", 0, D_TTY },
 	.d_open =	stlopen,
 	.d_close =	stlclose,
 	.d_read =	ttyread,
@@ -764,7 +763,7 @@ static void stl_drvinit(void *unused)
 {
 }
 
-SYSINIT(sidev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,stl_drvinit,NULL)
+SYSINIT(sidev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,stl_drvinit,NULL)
 
 #endif
 
diff --git a/sys/dev/serial/stli/istallion.c b/sys/dev/serial/stli/istallion.c
index da88508..8d321a3 100644
--- a/sys/dev/serial/stli/istallion.c
+++ b/sys/dev/serial/stli/istallion.c
@@ -631,9 +631,8 @@ struct isa_driver	stlidriver = {
  *	FreeBSD-2.2+ kernel linkage.
  */
 
-#define	CDEV_MAJOR	75
 static struct dev_ops stli_ops = {
-	{ stli_drvname, CDEV_MAJOR, D_TTY },
+	{ stli_drvname, 0, D_TTY },
 	.d_open =	stliopen,
 	.d_close =	stliclose,
 	.d_read =	stliread,
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index dfcf83c..096f83b 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -51,7 +51,7 @@ static int dsp_filter_read(struct knote *, long);
 static int dsp_filter_write(struct knote *, long);
 
 struct dev_ops dsp_ops = {
-	{ "dsp", SND_CDEV_MAJOR, 0},
+	{ "dsp", 0, 0},
 	/*.d_flags =	D_NEEDGIANT,*/
 	.d_open =	dsp_open,
 	.d_close =	dsp_close,
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index bc462fe..70dd07e 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -82,7 +82,7 @@ static d_open_t mixer_open;
 static d_close_t mixer_close;
 
 static struct dev_ops mixer_cdevsw = {
-	{ "mixer", SND_CDEV_MAJOR, D_TRACKCLOSE },
+	{ "mixer", 0, D_TRACKCLOSE },
 	/* .d_flags =	D_TRACKCLOSE | D_NEEDGIANT, */
 	.d_open =	mixer_open,
 	.d_close =	mixer_close,
diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c
index bf13a77..b31b5a2 100644
--- a/sys/dev/sound/pcm/sndstat.c
+++ b/sys/dev/sound/pcm/sndstat.c
@@ -47,7 +47,7 @@ static d_close_t sndstat_close;
 static d_read_t sndstat_read;
 
 static struct dev_ops sndstat_cdevsw = {
-	{ "sndstat", SND_CDEV_MAJOR, 0 },
+	{ "sndstat", 0, 0 },
 	/* .d_flags =	D_NEEDGIANT, */
 	.d_open =	sndstat_open,
 	.d_close =	sndstat_close,
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h
index ce0d9f4..15d3d00 100644
--- a/sys/dev/sound/pcm/sound.h
+++ b/sys/dev/sound/pcm/sound.h
@@ -146,11 +146,6 @@ nomenclature:
 struct pcm_channel *fkchan_setup(device_t dev);
 int fkchan_kill(struct pcm_channel *c);
 
-/*
- * Major nuber for the sound driver.
- */
-#define SND_CDEV_MAJOR 30
-
 /* XXX Flawed definition. I'll fix it someday. */
 #define	SND_MAXVCHANS	PCMMAXCHAN
 
diff --git a/sys/dev/usbmisc/ucom/ucom.c b/sys/dev/usbmisc/ucom/ucom.c
index f85c3b7..e197b24 100644
--- a/sys/dev/usbmisc/ucom/ucom.c
+++ b/sys/dev/usbmisc/ucom/ucom.c
@@ -118,10 +118,8 @@ static d_read_t  ucomread;
 static d_write_t ucomwrite;
 static d_ioctl_t ucomioctl;
 
-#define UCOM_CDEV_MAJOR  138
-
 static struct dev_ops ucom_ops = {
-	{ "ucom", UCOM_CDEV_MAJOR, D_TTY },
+	{ "ucom", 0, D_TTY },
 	.d_open =	ucomopen,
 	.d_close =	ucomclose,
 	.d_read =	ucomread,
diff --git a/sys/dev/usbmisc/ufm/ufm.c b/sys/dev/usbmisc/ufm/ufm.c
index 3ecb7ec..e6740f6 100644
--- a/sys/dev/usbmisc/ufm/ufm.c
+++ b/sys/dev/usbmisc/ufm/ufm.c
@@ -72,10 +72,8 @@ d_open_t  ufmopen;
 d_close_t ufmclose;
 d_ioctl_t ufmioctl;
 
-#define UFM_CDEV_MAJOR	200
-
 static struct dev_ops ufm_ops = {
-	{ "ufm", UFM_CDEV_MAJOR, 0 },
+	{ "ufm", 0, 0 },
 	.d_open = ufmopen,
 	.d_close = ufmclose,
 	.d_ioctl = ufmioctl,
diff --git a/sys/dev/usbmisc/ugen/ugen.c b/sys/dev/usbmisc/ugen/ugen.c
index 3922b58..5a7ec21 100644
--- a/sys/dev/usbmisc/ugen/ugen.c
+++ b/sys/dev/usbmisc/ugen/ugen.c
@@ -144,10 +144,8 @@ static void ugen_filt_detach(struct knote *);
 static int ugen_filt_read(struct knote *, long);
 static int ugen_filt_write(struct knote *, long);
 
-#define UGEN_CDEV_MAJOR	114
-
 static struct dev_ops ugen_ops = {
-	{ "ugen", UGEN_CDEV_MAJOR, 0 },
+	{ "ugen", 0, 0 },
 	.d_open =	ugenopen,
 	.d_close =	ugenclose,
 	.d_read =	ugenread,
diff --git a/sys/dev/usbmisc/uhid/uhid.c b/sys/dev/usbmisc/uhid/uhid.c
index 011decf..b296083 100644
--- a/sys/dev/usbmisc/uhid/uhid.c
+++ b/sys/dev/usbmisc/uhid/uhid.c
@@ -136,10 +136,8 @@ static void uhidfilt_detach(struct knote *);
 static int uhidfilt_read(struct knote *, long);
 static int uhidfilt_write(struct knote *, long);
 
-#define		UHID_CDEV_MAJOR 122
-
 static struct dev_ops uhid_ops = {
-	{ "uhid", UHID_CDEV_MAJOR, 0 },
+	{ "uhid", 0, 0 },
 	.d_open =	uhidopen,
 	.d_close =	uhidclose,
 	.d_read =	uhidread,
diff --git a/sys/dev/usbmisc/ulpt/ulpt.c b/sys/dev/usbmisc/ulpt/ulpt.c
index 70b5eba..f211c36 100644
--- a/sys/dev/usbmisc/ulpt/ulpt.c
+++ b/sys/dev/usbmisc/ulpt/ulpt.c
@@ -124,10 +124,8 @@ static d_close_t ulptclose;
 static d_write_t ulptwrite;
 static d_ioctl_t ulptioctl;
 
-#define ULPT_CDEV_MAJOR 113
-
 static struct dev_ops ulpt_ops = {
-	{ "ulpt", ULPT_CDEV_MAJOR, 0 },
+	{ "ulpt", 0, 0 },
 	.d_open =	ulptopen,
 	.d_close =	ulptclose,
 	.d_write =	ulptwrite,
diff --git a/sys/dev/usbmisc/ums/ums.c b/sys/dev/usbmisc/ums/ums.c
index ace91b2..78094a7 100644
--- a/sys/dev/usbmisc/ums/ums.c
+++ b/sys/dev/usbmisc/ums/ums.c
@@ -145,10 +145,8 @@ static d_kqfilter_t ums_kqfilter;
 static void ums_filt_detach(struct knote *);
 static int ums_filt(struct knote *, long);
 
-#define UMS_CDEV_MAJOR	111
-
 static struct dev_ops ums_ops = {
-	{ "ums", UMS_CDEV_MAJOR, 0 },
+	{ "ums", 0, 0 },
 	.d_open =	ums_open,
 	.d_close =	ums_close,
 	.d_read =	ums_read,
diff --git a/sys/dev/usbmisc/urio/urio.c b/sys/dev/usbmisc/urio/urio.c
index 85349bc..2300273 100644
--- a/sys/dev/usbmisc/urio/urio.c
+++ b/sys/dev/usbmisc/urio/urio.c
@@ -94,10 +94,8 @@ d_read_t  urioread;
 d_write_t uriowrite;
 d_ioctl_t urioioctl;
 
-#define URIO_CDEV_MAJOR	143
-
 static struct dev_ops urio_ops = {
-	{ "urio", URIO_CDEV_MAJOR, 0 },
+	{ "urio", 0, 0 },
 	.d_open =	urioopen,
 	.d_close =	urioclose,
 	.d_read =	urioread,
diff --git a/sys/dev/usbmisc/uscanner/uscanner.c b/sys/dev/usbmisc/uscanner/uscanner.c
index 87cf777..af99d90 100644
--- a/sys/dev/usbmisc/uscanner/uscanner.c
+++ b/sys/dev/usbmisc/uscanner/uscanner.c
@@ -256,10 +256,8 @@ d_read_t  uscannerread;
 d_write_t uscannerwrite;
 d_kqfilter_t uscannerkqfilter;
 
-#define USCANNER_CDEV_MAJOR	156
-
 static struct dev_ops uscanner_ops = {
-	{ "uscanner", USCANNER_CDEV_MAJOR, 0 },
+	{ "uscanner", 0, 0 },
 	.d_open =	uscanneropen,
 	.d_close =	uscannerclose,
 	.d_read =	uscannerread,
diff --git a/sys/dev/video/bktr/bktr_os.c b/sys/dev/video/bktr/bktr_os.c
index e5e05b6..563eb64 100644
--- a/sys/dev/video/bktr/bktr_os.c
+++ b/sys/dev/video/bktr/bktr_os.c
@@ -166,9 +166,8 @@ static	d_kqfilter_t	bktr_kqfilter;
 static void bktr_filter_detach(struct knote *);
 static int bktr_filter(struct knote *, long);
 
-#define CDEV_MAJOR 92 
 static struct dev_ops bktr_ops = {
-	{ "bktr", CDEV_MAJOR, 0 },
+	{ "bktr", 0, 0 },
 	.d_open =	bktr_open,
 	.d_close =	bktr_close,
 	.d_read =	bktr_read,
diff --git a/sys/dev/video/ctx/ctx.c b/sys/dev/video/ctx/ctx.c
index 0d1f9dc..98c636e 100644
--- a/sys/dev/video/ctx/ctx.c
+++ b/sys/dev/video/ctx/ctx.c
@@ -139,10 +139,9 @@ static	d_close_t	ctxclose;
 static	d_read_t	ctxread;
 static	d_write_t	ctxwrite;
 static	d_ioctl_t	ctxioctl;
-#define CDEV_MAJOR 40
 
 static struct dev_ops ctx_ops = {
-	{ "ctx", CDEV_MAJOR, 0 },
+	{ "ctx", 0, 0 },
 	.d_open =	ctxopen,
 	.d_close =	ctxclose,
 	.d_read =	ctxread,
diff --git a/sys/dev/video/cxm/cxm.c b/sys/dev/video/cxm/cxm.c
index e2064e6..caeb73f 100644
--- a/sys/dev/video/cxm/cxm.c
+++ b/sys/dev/video/cxm/cxm.c
@@ -125,10 +125,8 @@ static	d_kqfilter_t	cxm_kqfilter;
 static void cxm_filter_detach(struct knote *);
 static int cxm_filter(struct knote *, long);
 
-#define CDEV_MAJOR 93
-
 static struct dev_ops cxm_ops = {
-	{ "cxm", CDEV_MAJOR, 0 },
+	{ "cxm", 0, 0 },
 	.d_open =	cxm_open,
 	.d_close =	cxm_close,
 	.d_read =	cxm_read,
diff --git a/sys/dev/video/fb/fb.c b/sys/dev/video/fb/fb.c
index 7e91883..79fc38d 100644
--- a/sys/dev/video/fb/fb.c
+++ b/sys/dev/video/fb/fb.c
@@ -370,10 +370,8 @@ fbattach(device_t dev)
 static d_default_t	fboperate;
 static d_open_t		fbopen;
 
-#define CDEV_MAJOR	123	/* XXX */
-
 static struct dev_ops fb_ops = {
-	{ FB_DRIVER_NAME, CDEV_MAJOR, 0 },
+	{ FB_DRIVER_NAME, 0, 0 },
 	.d_default =	fboperate,
 	.d_open =	fbopen
 };
diff --git a/sys/dev/video/gsc/gsc.c b/sys/dev/video/gsc/gsc.c
index d94e295..63d2f0b 100644
--- a/sys/dev/video/gsc/gsc.c
+++ b/sys/dev/video/gsc/gsc.c
@@ -184,9 +184,8 @@ static	d_close_t	gscclose;
 static	d_read_t	gscread;
 static	d_ioctl_t	gscioctl;
 
-#define CDEV_MAJOR 47
 static struct dev_ops gsc_ops = {
-	{ "gsc", CDEV_MAJOR, 0 },
+	{ "gsc", 0, 0 },
 	.d_open =	gscopen,
 	.d_close =	gscclose,
 	.d_read =	gscread,
diff --git a/sys/dev/video/meteor/meteor.c b/sys/dev/video/meteor/meteor.c
index 9214a31..18d81c6 100644
--- a/sys/dev/video/meteor/meteor.c
+++ b/sys/dev/video/meteor/meteor.c
@@ -220,9 +220,8 @@ static	d_write_t	meteor_write;
 static	d_ioctl_t	meteor_ioctl;
 static	d_mmap_t	meteor_mmap;
 
-#define CDEV_MAJOR 67
 static struct dev_ops meteor_ops = {
-	{ "meteor", CDEV_MAJOR, 0 },
+	{ "meteor", 0, 0 },
 	.d_open =	meteor_open,
 	.d_close =	meteor_close,
 	.d_read =	meteor_read,
diff --git a/sys/dev/virtual/cdrom/vcd.c b/sys/dev/virtual/cdrom/vcd.c
index 849233e..ec0cc53 100644
--- a/sys/dev/virtual/cdrom/vcd.c
+++ b/sys/dev/virtual/cdrom/vcd.c
@@ -62,13 +62,11 @@ struct vcd_softc {
 	int fd;
 };
 
-#define CDEV_MAJOR	98
-
 static d_strategy_t	vcdstrategy;
 static d_open_t		vcdopen;
 
 static struct dev_ops vcd_ops = {
-	{ "vcd", CDEV_MAJOR, D_DISK },
+	{ "vcd", 0, D_DISK },
         .d_open =	vcdopen,
         .d_close =	nullclose,
         .d_read =	physread,
diff --git a/sys/dev/virtual/disk/vdisk.c b/sys/dev/virtual/disk/vdisk.c
index 70f225f..e7ac87f 100644
--- a/sys/dev/virtual/disk/vdisk.c
+++ b/sys/dev/virtual/disk/vdisk.c
@@ -67,8 +67,6 @@ struct vkd_softc {
 	int fd;
 };
 
-#define CDEV_MAJOR	97
-
 static void vkd_io_thread(cothread_t cotd);
 static void vkd_io_intr(cothread_t cotd);
 static void vkd_doio(struct vkd_softc *sc, struct bio *bio);
@@ -77,7 +75,7 @@ static d_strategy_t	vkdstrategy;
 static d_open_t		vkdopen;
 
 static struct dev_ops vkd_ops = {
-	{ "vkd", CDEV_MAJOR, D_DISK },
+	{ "vkd", 0, D_DISK },
         .d_open =	vkdopen,
         .d_close =	nullclose,
         .d_read =	physread,
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 545f4c6..d842094 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -123,9 +123,8 @@ static struct krate krate_uidinfo = { .freq = 1 };
 static	 d_open_t  fdopen;
 #define NUMFDESC 64
 
-#define CDEV_MAJOR 22
 static struct dev_ops fildesc_ops = {
-	{ "FD", CDEV_MAJOR, 0 },
+	{ "FD", 0, 0 },
 	.d_open =	fdopen,
 };
 
@@ -2857,5 +2856,4 @@ nofo_shutdown(struct file *fp, int how)
 	return (EOPNOTSUPP);
 }
 
-SYSINIT(fildescdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,
-					fildesc_drvinit,NULL)
+SYSINIT(fildescdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,fildesc_drvinit,NULL)
diff --git a/sys/kern/kern_memio.c b/sys/kern/kern_memio.c
index 989b343..9121d75 100644
--- a/sys/kern/kern_memio.c
+++ b/sys/kern/kern_memio.c
@@ -78,9 +78,8 @@ static	d_ioctl_t	mmioctl;
 static	d_mmap_t	memmmap;
 static	d_kqfilter_t	mmkqfilter;
 
-#define CDEV_MAJOR 2
 static struct dev_ops mem_ops = {
-	{ "mem", CDEV_MAJOR, D_MPSAFE },
+	{ "mem", 0, D_MPSAFE },
 	.d_open =	mmopen,
 	.d_close =	mmclose,
 	.d_read =	mmread,
@@ -603,5 +602,5 @@ mem_drvinit(void *unused)
 	make_dev(&mem_ops, 14, UID_ROOT, GID_WHEEL, 0600, "io");
 }
 
-SYSINIT(memdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,mem_drvinit,NULL)
+SYSINIT(memdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,mem_drvinit,NULL)
 
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 26cdd6f..3794c5c 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -135,8 +135,6 @@ TUNABLE_INT("hw.bus.devctl_disable", &devctl_disable);
 SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, 0, 0,
     sysctl_devctl_disable, "I", "devctl disable");
 
-#define	CDEV_MAJOR	188
-
 static d_open_t		devopen;
 static d_close_t	devclose;
 static d_read_t		devread;
@@ -144,7 +142,7 @@ static d_ioctl_t	devioctl;
 static d_kqfilter_t	devkqfilter;
 
 static struct dev_ops devctl_ops = {
-	{ "devctl", CDEV_MAJOR, 0 },
+	{ "devctl", 0, 0 },
 	.d_open =	devopen,
 	.d_close =	devclose,
 	.d_read =	devread,
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index b98b2b9..de1fcf6 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -68,9 +68,8 @@ static	void logtimeout(void *arg);
 static	void logfiltdetach(struct knote *kn);
 static	int  logfiltread(struct knote *kn, long hint);
 
-#define CDEV_MAJOR 7
 static struct dev_ops log_ops = {
-	{ "log", CDEV_MAJOR, 0 },
+	{ "log", 0, 0 },
 	.d_open =	logopen,
 	.d_close =	logclose,
 	.d_read =	logread,
@@ -282,4 +281,4 @@ log_drvinit(void *unused)
 	make_dev(&log_ops, 0, UID_ROOT, GID_WHEEL, 0600, "klog");
 }
 
-SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,log_drvinit,NULL)
+SYSINIT(logdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,log_drvinit,NULL)
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index 409fc2e..68c69d4 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -70,9 +70,8 @@ static d_kqfilter_t cnkqfilter;
 
 static int cnintercept(struct dev_generic_args *ap);
 
-#define	CDEV_MAJOR	0
 static struct dev_ops cn_ops = {
-	{ "console", CDEV_MAJOR, D_TTY },
+	{ "console", 0, D_TTY },
 	.d_open =	cnopen,
 	.d_close =	cnclose,
 	.d_read =	cnread,
@@ -82,7 +81,7 @@ static struct dev_ops cn_ops = {
 };
 
 static struct dev_ops cn_iops = {
-	{ "intercept", CDEV_MAJOR, D_TTY },
+	{ "intercept", 0, D_TTY },
 	.d_default =    cnintercept
 };
 
@@ -549,4 +548,4 @@ cn_drvinit(void *unused)
 					  0600, "console");
 }
 
-SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cn_drvinit,NULL)
+SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,cn_drvinit,NULL)
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 8576b7c..0ab48a4 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -127,9 +127,8 @@ static struct dev_ops ptc98_ops = {
 };
 #endif
 
-#define	CDEV_MAJOR_S	5
 static struct dev_ops pts_ops = {
-	{ "pts", CDEV_MAJOR_S, D_TTY },
+	{ "pts", 0, D_TTY },
 	.d_open =	ptsopen,
 	.d_close =	ptsclose,
 	.d_read =	ptsread,
@@ -139,9 +138,8 @@ static struct dev_ops pts_ops = {
 	.d_revoke =	ttyrevoke
 };
 
-#define	CDEV_MAJOR_C	6
 static struct dev_ops ptc_ops = {
-	{ "ptc", CDEV_MAJOR_C, D_TTY | D_MASTER },
+	{ "ptc", 0, D_TTY | D_MASTER },
 	.d_open =	ptcopen,
 	.d_close =	ptcclose,
 	.d_read =	ptcread,
@@ -1304,4 +1302,4 @@ ptc_drvinit(void *unused)
 	}
 }
 
-SYSINIT(ptcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR_C,ptc_drvinit,NULL)
+SYSINIT(ptcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,ptc_drvinit,NULL)
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index efdeeb8..fcf1191 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -65,9 +65,8 @@ static void cttyfilt_detach(struct knote *);
 static int cttyfilt_read(struct knote *, long);
 static int cttyfilt_write(struct knote *, long);
 
-#define	CDEV_MAJOR	1
 static struct dev_ops ctty_ops = {
-	{ "ctty", CDEV_MAJOR, D_TTY },
+	{ "ctty", 0, D_TTY },
 	.d_open =	cttyopen,
 	.d_close =	cttyclose,
 	.d_read =	cttyread,
@@ -319,4 +318,4 @@ ctty_drvinit(void *unused __unused)
 	make_dev(&ctty_ops, 0, 0, 0, 0666, "tty");
 }
 
-SYSINIT(cttydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,ctty_drvinit,NULL)
+SYSINIT(cttydev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,ctty_drvinit,NULL)
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index f54e78c..436c0a4 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -139,9 +139,8 @@ static d_write_t	bpfwrite;
 static d_ioctl_t	bpfioctl;
 static d_kqfilter_t	bpfkqfilter;
 
-#define CDEV_MAJOR 23
 static struct dev_ops bpf_ops = {
-	{ "bpf", CDEV_MAJOR, 0 },
+	{ "bpf", 0, 0 },
 	.d_open =	bpfopen,
 	.d_close =	bpfclose,
 	.d_read =	bpfread,
@@ -1589,8 +1588,8 @@ bpf_drvuninit(void *unused)
 	devfs_clone_bitmap_uninit(&DEVFS_CLONE_BITMAP(bpf));
 }
 
-SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,bpf_drvinit,NULL)
-SYSUNINIT(bpfdev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,bpf_drvuninit, NULL);
+SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,bpf_drvinit,NULL)
+SYSUNINIT(bpfdev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE,bpf_drvuninit, NULL);
 
 #else /* !BPF */
 /*
diff --git a/sys/net/i4b/driver/i4b_ctl.c b/sys/net/i4b/driver/i4b_ctl.c
index 5dff7cc..82654e2 100644
--- a/sys/net/i4b/driver/i4b_ctl.c
+++ b/sys/net/i4b/driver/i4b_ctl.c
@@ -66,10 +66,8 @@ static	d_open_t	i4bctlopen;
 static	d_close_t	i4bctlclose;
 static	d_ioctl_t	i4bctlioctl;
 
-#define CDEV_MAJOR 55
-
 static struct dev_ops i4bctl_ops = {
-	{ "i4bctl", CDEV_MAJOR, 0 },
+	{ "i4bctl", 0, 0 },
 	.d_open =      i4bctlopen,
 	.d_close =     i4bctlclose,
 	.d_ioctl =     i4bctlioctl,
diff --git a/sys/net/i4b/driver/i4b_rbch.c b/sys/net/i4b/driver/i4b_rbch.c
index c4ec9cf..7a0faf9 100644
--- a/sys/net/i4b/driver/i4b_rbch.c
+++ b/sys/net/i4b/driver/i4b_rbch.c
@@ -124,10 +124,8 @@ PDEVSTATIC void i4brbchkfilt_detach(struct knote *);
 PDEVSTATIC int i4brbchkfilt_read(struct knote *, long);
 PDEVSTATIC int i4brbchkfilt_write(struct knote *, long);
 
-#define CDEV_MAJOR 57
-
 static struct dev_ops i4brbch_ops = {
-	{ "i4brbch", CDEV_MAJOR, 0 },
+	{ "i4brbch", 0, 0 },
 	.d_open =	i4brbchopen,
 	.d_close =	i4brbchclose,
 	.d_read =	i4brbchread,
diff --git a/sys/net/i4b/driver/i4b_tel.c b/sys/net/i4b/driver/i4b_tel.c
index 2b1638d..7aeb44d 100644
--- a/sys/net/i4b/driver/i4b_tel.c
+++ b/sys/net/i4b/driver/i4b_tel.c
@@ -147,10 +147,8 @@ PDEVSTATIC void i4btelfilt_detach(struct knote *);
 PDEVSTATIC int i4btelfilt_read(struct knote *, long);
 PDEVSTATIC int i4btelfilt_write(struct knote *, long);
 
-#define CDEV_MAJOR 56
-
 static struct dev_ops i4btel_ops = {
-	{ "i4btel", CDEV_MAJOR, 0 },
+	{ "i4btel", 0, 0 },
 	.d_open =	i4btelopen,
 	.d_close =	i4btelclose,
 	.d_read =	i4btelread,
diff --git a/sys/net/i4b/driver/i4b_trace.c b/sys/net/i4b/driver/i4b_trace.c
index dd14c2f..00e18f0 100644
--- a/sys/net/i4b/driver/i4b_trace.c
+++ b/sys/net/i4b/driver/i4b_trace.c
@@ -73,10 +73,8 @@ static d_close_t i4btrcclose;
 static d_read_t i4btrcread;
 static d_ioctl_t i4btrcioctl;
 
-#define CDEV_MAJOR 59
-
 static struct dev_ops i4btrc_ops = {
-	{ "i4btrc", CDEV_MAJOR, 0 },
+	{ "i4btrc", 0, 0 },
 	.d_open =	i4btrcopen,
         .d_close =	i4btrcclose,
         .d_read =	i4btrcread,
diff --git a/sys/net/i4b/layer4/i4b_i4bdrv.c b/sys/net/i4b/layer4/i4b_i4bdrv.c
index 689140c..588cc46 100644
--- a/sys/net/i4b/layer4/i4b_i4bdrv.c
+++ b/sys/net/i4b/layer4/i4b_i4bdrv.c
@@ -91,10 +91,8 @@ PDEVSTATIC void i4bkqfilt_detach(struct knote *);
 PDEVSTATIC int i4bkqfilt_read(struct knote *, long);
 PDEVSTATIC int i4bkqfilt_write(struct knote *, long);
 
-#define CDEV_MAJOR 60
-
 static struct dev_ops i4b_ops = {
-	{ "i4b", CDEV_MAJOR, 0 },
+	{ "i4b", 0, 0 },
 	.d_open =	i4bopen,
 	.d_close =	i4bclose,
 	.d_read =	i4bread,
diff --git a/sys/net/tap/if_tap.c b/sys/net/tap/if_tap.c
index 8424362..0662ee9 100644
--- a/sys/net/tap/if_tap.c
+++ b/sys/net/tap/if_tap.c
@@ -80,7 +80,6 @@
 #define TAP_PREALLOCATED_UNITS	4
 
 #define CDEV_NAME	"tap"
-#define CDEV_MAJOR	149
 #define TAPDEBUG	if (tapdebug) if_printf
 
 #define TAP		"tap"
@@ -119,7 +118,7 @@ static d_ioctl_t	tapioctl;
 static d_kqfilter_t	tapkqfilter;
 
 static struct dev_ops	tap_ops = {
-	{ CDEV_NAME, CDEV_MAJOR, 0 },
+	{ CDEV_NAME, 0, 0 },
 	.d_open =	tapopen,
 	.d_close =	tapclose,
 	.d_read =	tapread,
diff --git a/sys/net/tun/if_tun.c b/sys/net/tun/if_tun.c
index 6c851c5..0c0205d 100644
--- a/sys/net/tun/if_tun.c
+++ b/sys/net/tun/if_tun.c
@@ -97,9 +97,8 @@ DEVFS_DECLARE_CLONE_BITMAP(tun);
 #define TUN_PREALLOCATED_UNITS	NTUN
 #endif
 
-#define CDEV_MAJOR 52
 static struct dev_ops tun_ops = {
-	{ "tun", CDEV_MAJOR, 0 },
+	{ "tun", 0, 0 },
 	.d_open =	tunopen,
 	.d_close =	tunclose,
 	.d_read =	tunread,
diff --git a/sys/netproto/smb/smb_dev.c b/sys/netproto/smb/smb_dev.c
index 86219ea..f5269bb 100644
--- a/sys/netproto/smb/smb_dev.c
+++ b/sys/netproto/smb/smb_dev.c
@@ -87,7 +87,7 @@ int smb_dev_queue(struct smb_dev *ndp, struct smb_rq *rqp, int prio);
 */
 
 static struct dev_ops nsmb_ops = {
-	{ NSMB_NAME, NSMB_MAJOR, 0 },
+	{ NSMB_NAME, 0, 0 },
 	.d_open =	nsmb_dev_open,
 	.d_close =	nsmb_dev_close,
 	.d_read =	nsmb_dev_read,
diff --git a/sys/netproto/smb/smb_dev.h b/sys/netproto/smb/smb_dev.h
index 6fb4765..0cd27e4 100644
--- a/sys/netproto/smb/smb_dev.h
+++ b/sys/netproto/smb/smb_dev.h
@@ -43,7 +43,6 @@
 #include "smb.h"
 
 #define	NSMB_NAME		"nsmb"
-#define	NSMB_MAJOR		144
 
 #define NSMB_VERMAJ	1
 #define NSMB_VERMIN	3006
diff --git a/sys/platform/pc32/acpica5/acpi_machdep.c b/sys/platform/pc32/acpica5/acpi_machdep.c
index 6985f1d..5a39411 100644
--- a/sys/platform/pc32/acpica5/acpi_machdep.c
+++ b/sys/platform/pc32/acpica5/acpi_machdep.c
@@ -68,9 +68,8 @@ static d_write_t apmwrite;
 static d_ioctl_t apmioctl;
 static d_kqfilter_t apmkqfilter;
 
-#define CDEV_MAJOR 39
 static struct dev_ops apm_ops = {
-	{ "apm", CDEV_MAJOR, 0 },
+	{ "apm", 0, 0 },
         .d_open = apmopen,
         .d_close = apmclose,
 	.d_write = apmwrite,
diff --git a/sys/platform/pc32/apm/apm.c b/sys/platform/pc32/apm/apm.c
index e4d9421..0591eaa 100644
--- a/sys/platform/pc32/apm/apm.c
+++ b/sys/platform/pc32/apm/apm.c
@@ -87,9 +87,8 @@ static void apmfilter_detach(struct knote *);
 static int apmfilter_read(struct knote *, long);
 static int apmfilter_write(struct knote *, long);
 
-#define CDEV_MAJOR 39
 static struct dev_ops apm_ops = {
-	{ "apm", CDEV_MAJOR, 0 },
+	{ "apm", 0, 0 },
 	.d_open =	apmopen,
 	.d_close =	apmclose,
 	.d_write =	apmwrite,
diff --git a/sys/platform/pc32/i386/elan-mmcr.c b/sys/platform/pc32/i386/elan-mmcr.c
index 0dd0fe4..197cbc8 100644
--- a/sys/platform/pc32/i386/elan-mmcr.c
+++ b/sys/platform/pc32/i386/elan-mmcr.c
@@ -95,9 +95,8 @@ static d_close_t elan_close;
 static d_ioctl_t elan_ioctl;
 static d_mmap_t elan_mmap;
 
-#define CDEV_MAJOR 100
 static struct dev_ops elan_ops = {
-	{ "elan", CDEV_MAJOR, 0 },
+	{ "elan", 0, 0 },
 	.d_open =	elan_open,
 	.d_close =	elan_close,
 	.d_ioctl =	elan_ioctl,
@@ -141,4 +140,4 @@ elan_drvinit(void)
 	make_dev(&elan_ops, 0, UID_ROOT, GID_WHEEL, 0600, "elan-mmcr");
 }
 
-SYSINIT(elan, SI_SUB_PSEUDO, SI_ORDER_MIDDLE+CDEV_MAJOR,elan_drvinit,NULL);
+SYSINIT(elan, SI_SUB_PSEUDO, SI_ORDER_MIDDLE,elan_drvinit,NULL);
diff --git a/sys/platform/pc32/i386/perfmon.c b/sys/platform/pc32/i386/perfmon.c
index 5503498..0722fc2 100644
--- a/sys/platform/pc32/i386/perfmon.c
+++ b/sys/platform/pc32/i386/perfmon.c
@@ -62,9 +62,8 @@ static d_close_t	perfmon_close;
 static d_open_t		perfmon_open;
 static d_ioctl_t	perfmon_ioctl;
 
-#define CDEV_MAJOR 2	/* We're really a minor of mem.c */
 static struct dev_ops perfmon_ops = {
-	{ "perfmon", CDEV_MAJOR, 0 },
+	{ "perfmon", 0, 0 },
 	.d_open =	perfmon_open,
 	.d_close =	perfmon_close,
 	.d_ioctl =	perfmon_ioctl,
diff --git a/sys/platform/pc32/isa/asc.c b/sys/platform/pc32/isa/asc.c
index f64614b..ccee9a3 100644
--- a/sys/platform/pc32/isa/asc.c
+++ b/sys/platform/pc32/isa/asc.c
@@ -189,10 +189,8 @@ static d_kqfilter_t	asckqfilter;
 static void ascfilter_detach(struct knote *kn);
 static int ascfilter(struct knote *kn, long hint);
 
-#define CDEV_MAJOR 71
-
 static struct dev_ops asc_ops = {
-	{ "asc", CDEV_MAJOR, 0 },
+	{ "asc", 0, 0 },
 	.d_open =	ascopen,
 	.d_close =	ascclose,
 	.d_read =	ascread,
diff --git a/sys/platform/pc64/acpica5/acpi_machdep.c b/sys/platform/pc64/acpica5/acpi_machdep.c
index 33d2ad6..90f3c44 100644
--- a/sys/platform/pc64/acpica5/acpi_machdep.c
+++ b/sys/platform/pc64/acpica5/acpi_machdep.c
@@ -64,9 +64,8 @@ static d_write_t apmwrite;
 static d_ioctl_t apmioctl;
 static d_kqfilter_t apmkqfilter;
 
-#define CDEV_MAJOR 39
 static struct dev_ops apm_ops = {
-	{ "apm", CDEV_MAJOR, 0 },
+	{ "apm", 0, 0 },
         .d_open = apmopen,
         .d_close = apmclose,
 	.d_write = apmwrite,
diff --git a/sys/platform/pc64/apm/apm.c b/sys/platform/pc64/apm/apm.c
index 5d2e622..74551df 100644
--- a/sys/platform/pc64/apm/apm.c
+++ b/sys/platform/pc64/apm/apm.c
@@ -87,9 +87,8 @@ static void apmfilter_detach(struct knote *);
 static int apmfilter_read(struct knote *, long);
 static int apmfilter_write(struct knote *, long);
 
-#define CDEV_MAJOR 39
 static struct dev_ops apm_ops = {
-	{ "apm", CDEV_MAJOR, 0 },
+	{ "apm", 0, 0 },
 	.d_open =	apmopen,
 	.d_close =	apmclose,
 	.d_write =	apmwrite,
diff --git a/sys/platform/pc64/isa/asc.c b/sys/platform/pc64/isa/asc.c
index d36c34e..e8cb6a8 100644
--- a/sys/platform/pc64/isa/asc.c
+++ b/sys/platform/pc64/isa/asc.c
@@ -188,10 +188,8 @@ static d_kqfilter_t	asckqfilter;
 static void ascfilter_detach(struct knote *kn);
 static int ascfilter(struct knote *kn, long hint);
 
-#define CDEV_MAJOR 71
-
 static struct dev_ops asc_ops = {
-	{ "asc", CDEV_MAJOR, 0 },
+	{ "asc", 0, 0 },
 	.d_open =	ascopen,
 	.d_close =	ascclose,
 	.d_read =	ascread,
diff --git a/sys/platform/vkernel/platform/console.c b/sys/platform/vkernel/platform/console.c
index 36ab336..1f5e183 100644
--- a/sys/platform/vkernel/platform/console.c
+++ b/sys/platform/vkernel/platform/console.c
@@ -60,8 +60,6 @@ static struct kqueue_info *kqueue_console_info;
  *
  */
 
-#define CDEV_MAJOR	12	/* steal the same major as /dev/ttyv* */
-
 static int vcons_tty_param(struct tty *tp, struct termios *tio);
 static void vcons_tty_start(struct tty *tp);
 static void vcons_intr(void *tpx, struct intrframe *frame __unused);
@@ -71,7 +69,7 @@ static d_close_t        vcons_close;
 static d_ioctl_t        vcons_ioctl;
 
 static struct dev_ops vcons_ops = {
-	{ "vcons", CDEV_MAJOR, D_TTY },
+	{ "vcons", 0, D_TTY },
 	.d_open =	vcons_open,
 	.d_close =	vcons_close,
 	.d_read =	ttyread,
diff --git a/sys/platform/vkernel64/platform/console.c b/sys/platform/vkernel64/platform/console.c
index 7835e24..d87cb5b 100644
--- a/sys/platform/vkernel64/platform/console.c
+++ b/sys/platform/vkernel64/platform/console.c
@@ -60,8 +60,6 @@ static struct kqueue_info *kqueue_console_info;
  *
  */
 
-#define CDEV_MAJOR	12	/* steal the same major as /dev/ttyv* */
-
 static int vcons_tty_param(struct tty *tp, struct termios *tio);
 static void vcons_tty_start(struct tty *tp);
 static void vcons_intr(void *tpx, struct intrframe *frame __unused);
@@ -71,7 +69,7 @@ static d_close_t        vcons_close;
 static d_ioctl_t        vcons_ioctl;
 
 static struct dev_ops vcons_ops = {
-	{ "vcons", CDEV_MAJOR, D_TTY },
+	{ "vcons", 0, D_TTY },
 	.d_open =	vcons_open,
 	.d_close =	vcons_close,
 	.d_read =	ttyread,
-- 
1.6.6.1

