From 268e76d86e468587222011577f1ae5f5a9eb6542 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 22 Dec 2011 16:01:10 +0000 Subject: [PATCH] Use TASK_INITIALIZER() for dev_dtr_task rather than a dedicated SYSINIT(). --- sys/kern/kern_conf.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 267a20716e28..85737e8873d5 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -55,6 +55,7 @@ struct mtx devmtx; static void destroy_devl(struct cdev *dev); static int destroy_dev_sched_cbl(struct cdev *dev, void (*cb)(void *), void *arg); +static void destroy_dev_tq(void *ctx, int pending); static int make_dev_credv(int flags, struct cdev **dres, struct cdevsw *devsw, int unit, struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, va_list ap); @@ -1298,7 +1299,7 @@ clone_cleanup(struct clonedevs **cdp) static TAILQ_HEAD(, cdev_priv) dev_ddtr = TAILQ_HEAD_INITIALIZER(dev_ddtr); -static struct task dev_dtr_task; +static struct task dev_dtr_task = TASK_INITIALIZER(0, destroy_dev_tq, NULL); static void destroy_dev_tq(void *ctx, int pending) @@ -1386,15 +1387,6 @@ drain_dev_clone_events(void) sx_xunlock(&clone_drain_lock); } -static void -devdtr_init(void *dummy __unused) -{ - - TASK_INIT(&dev_dtr_task, 0, destroy_dev_tq, NULL); -} - -SYSINIT(devdtr, SI_SUB_DEVFS, SI_ORDER_SECOND, devdtr_init, NULL); - #include "opt_ddb.h" #ifdef DDB #include