diff options
author | bde <bde@FreeBSD.org> | 1995-12-14 22:03:12 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-12-14 22:03:12 +0000 |
commit | 956b9c95d2207ac92e31e30c9df2462c12336c25 (patch) | |
tree | 11ce3a123854b60fee7cdc42f084330319586201 /sys/i386/isa/pcvt/pcvt_drv.c | |
parent | 2141527fc798c021b7f0cc65339fbb6f9eef475d (diff) | |
download | FreeBSD-src-956b9c95d2207ac92e31e30c9df2462c12336c25.zip FreeBSD-src-956b9c95d2207ac92e31e30c9df2462c12336c25.tar.gz |
Removed my devsw access functions [un]register_cdev() and
getmajorbyname() which were a better (sigh) temporary interface to
the going-away devswitches.
Note that SYSINIT()s to initialize the devswitches would be fatal
in syscons.c and pcvt_drv.c (and are bogus elsewhere) because they
get called independently of whether the device is attached; thus
devices that share a major clobber each other's devswitch entries
until the last one wins.
conf.c:
Removed stale #includes and comments.
Diffstat (limited to 'sys/i386/isa/pcvt/pcvt_drv.c')
-rw-r--r-- | sys/i386/isa/pcvt/pcvt_drv.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c index 6e5529e..bee2269 100644 --- a/sys/i386/isa/pcvt/pcvt_drv.c +++ b/sys/i386/isa/pcvt/pcvt_drv.c @@ -115,6 +115,7 @@ static d_ioctl_t pcioctl; static d_devtotty_t pcdevtotty; static d_mmap_t pcmmap; +#define CDEV_MAJOR 12 static struct cdevsw pcdevsw = { pcopen, pcclose, pcread, pcwrite, pcioctl, nullstop, noreset, pcdevtotty, @@ -326,7 +327,11 @@ pcattach(struct isa_device *dev) pcvt_is_console? DC_IDLE: DC_BUSY; vt_registerdev(dev, (char *)vga_string(vga_type)); - register_cdev("vt", &pcdevsw); + { + dev_t dev = makedev(CDEV_MAJOR, 0); + + cdevsw_add(&dev, &pcdevsw, NULL); + } #endif /* PCVT_FREEBSD > 205 */ #if PCVT_NETBSD > 9 @@ -1107,15 +1112,14 @@ pccnprobe(struct consdev *cp) * Take control if we are the highest priority enabled display device. */ dvp = find_display(); - maj = getmajorbyname("vt"); - if (dvp->id_driver != &vtdriver || maj < 0) { + if (dvp != NULL && dvp->id_driver != &vtdriver) { cp->cn_pri = CN_DEAD; return; } /* initialize required fields */ - cp->cn_dev = makedev(maj, 0); + cp->cn_dev = makedev(CDEV_MAJOR, 0); cp->cn_pri = CN_INTERNAL; #if !PCVT_NETBSD |