summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-05-24 20:27:16 +0000
committerphk <phk@FreeBSD.org>2001-05-24 20:27:16 +0000
commit170ee567dda564271d63c7d5747c27f0b11018d1 (patch)
treed54192614bfca29a182ad1bb90c67364cc4d0d8f
parentc2dacad2c36d8a679df00b0bb14a54db7b7b918c (diff)
downloadFreeBSD-src-170ee567dda564271d63c7d5747c27f0b11018d1.zip
FreeBSD-src-170ee567dda564271d63c7d5747c27f0b11018d1.tar.gz
Don't take the detour around devsw() to find out if the proto-cdevsw
is already initialized.
-rw-r--r--sys/kern/subr_disk.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 5e90426..c50c21a 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -109,15 +109,13 @@ disk_create(int unit, struct disk *dp, int flags, struct cdevsw *cdevsw, struct
bzero(dp, sizeof(*dp));
- dev = makedev(cdevsw->d_maj, 0);
- if (!devsw(dev)) {
+ if (proto->d_open != diskopen) {
*proto = *cdevsw;
proto->d_open = diskopen;
proto->d_close = diskclose;
proto->d_ioctl = diskioctl;
proto->d_strategy = diskstrategy;
proto->d_psize = diskpsize;
- cdevsw_add(proto);
}
if (bootverbose)
OpenPOWER on IntegriCloud