diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 21052f10ee37..86c6a411d29a 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -325,16 +325,11 @@ makeudev(int x, int y) return ((x << 8) | y); } -dev_t -make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const char *fmt, ...) +static void +prep_cdevsw(struct cdevsw *devsw) { - dev_t dev; - va_list ap; int i; - KASSERT((minor & ~0xffff00ff) == 0, - ("Invalid minor (0x%x) in make_dev", minor)); - if (devsw->d_open == NULL) devsw->d_open = null_open; if (devsw->d_close == NULL) devsw->d_close = null_close; if (devsw->d_read == NULL) devsw->d_read = no_read; @@ -365,7 +360,19 @@ make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const reserved_majors[devsw->d_maj] = devsw->d_maj; } } +} +dev_t +make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const char *fmt, ...) +{ + dev_t dev; + va_list ap; + int i; + + KASSERT((minor & ~0xffff00ff) == 0, + ("Invalid minor (0x%x) in make_dev", minor)); + + prep_cdevsw(devsw); dev = makedev(devsw->d_maj, minor); if (dev->si_flags & SI_CHEAPCLONE && dev->si_flags & SI_NAMED &&