aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/snp/snp.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2007-07-05 13:07:12 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2007-07-05 13:07:12 +0000
commit542a8db549f73516381284ad071b8cc5f750939e (patch)
treea5db23f4c5a9cb54fe4b1a0f48169d4497ba982c /sys/dev/snp/snp.c
parent196a7385acb0d6bf992643e0abad7154794881e2 (diff)
downloadsrc-542a8db549f73516381284ad071b8cc5f750939e.tar.gz
src-542a8db549f73516381284ad071b8cc5f750939e.zip
Adopt snp to the destroy_dev_sched() KPI after reverting of destroy_dev()
to not call destroy_dev_sched(). Tested by: Peter Holm Approved by: re (kensmith)
Notes
Notes: svn path=/head/; revision=171252
Diffstat (limited to 'sys/dev/snp/snp.c')
-rw-r--r--sys/dev/snp/snp.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index e61191f061b8..08c6c55e4763 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -118,7 +118,7 @@ static struct clonedevs *snpclones;
static struct tty *snpdevtotty(struct cdev *dev);
static void snp_clone(void *arg, struct ucred *cred, char *name,
int namelen, struct cdev **dev);
-static int snp_detach(struct snoop *snp);
+static void snp_detach(void *arg);
static int snp_down(struct snoop *snp);
static int snp_in(struct snoop *snp, char *buf, int n);
static int snp_modevent(module_t mod, int what, void *arg);
@@ -422,11 +422,13 @@ snpopen(struct cdev *dev, int flag, int mode, struct thread *td)
}
-static int
-snp_detach(struct snoop *snp)
+static void
+snp_detach(void *arg)
{
+ struct snoop *snp;
struct tty *tp;
+ snp = (struct snoop *)arg;
snp->snp_base = 0;
snp->snp_len = 0;
@@ -451,8 +453,6 @@ detach_notty:
selwakeuppri(&snp->snp_sel, PZERO + 1);
if ((snp->snp_flags & SNOOP_OPEN) == 0)
free(snp, M_SNP);
-
- return (0);
}
static int
@@ -466,9 +466,9 @@ snpclose(struct cdev *dev, int flags, int fmt, struct thread *td)
free(snp->snp_buf, M_SNP);
snp->snp_flags &= ~SNOOP_OPEN;
dev->si_drv1 = NULL;
- destroy_dev(dev);
+ destroy_dev_sched_cb(dev, snp_detach, snp);
- return (snp_detach(snp));
+ return (0);
}
static int
@@ -481,8 +481,9 @@ snp_down(struct snoop *snp)
snp->snp_blen = SNOOP_MINLEN;
}
snp->snp_flags |= SNOOP_DOWN;
+ snp_detach(snp);
- return (snp_detach(snp));
+ return (0);
}
static int