From 40dd98a3bd2049465e7644b361b60da41a46efa0 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 17 Jun 2004 17:16:53 +0000 Subject: Second half of the dev_t cleanup. The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc. --- sys/dev/snp/snp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/dev/snp') diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index 752dc42..6544810 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -406,7 +406,7 @@ snpopen(dev, flag, mode, td) * snp_tty == NULL is for inactive snoop devices. */ snp->snp_tty = NULL; - snp->snp_target = NODEV; + snp->snp_target = NULL; LIST_INSERT_HEAD(&snp_sclist, snp, snp_list); return (0); @@ -439,7 +439,7 @@ snp_detach(snp) printf("snp%d: bad attached tty data\n", snp->snp_unit); snp->snp_tty = NULL; - snp->snp_target = NODEV; + snp->snp_target = NULL; detach_notty: selwakeuppri(&snp->snp_sel, PZERO + 1); @@ -500,8 +500,8 @@ snpioctl(dev, cmd, data, flags, td) snp = dev->si_drv1; switch (cmd) { case SNPSTTY: - tdev = udev2dev(*((udev_t *)data)); - if (tdev == NODEV) + tdev = findcdev(*((dev_t *)data)); + if (tdev == NULL) return (snp_down(snp)); tp = snpdevtotty(tdev); @@ -512,7 +512,7 @@ snpioctl(dev, cmd, data, flags, td) s = spltty(); - if (snp->snp_target == NODEV) { + if (snp->snp_target == NULL) { tpo = snp->snp_tty; if (tpo) tpo->t_state &= ~TS_SNOOP; @@ -540,7 +540,7 @@ snpioctl(dev, cmd, data, flags, td) * SNPGTTY happy, else we can't know what is device * major/minor for tty. */ - *((udev_t *)data) = dev2udev(snp->snp_target); + *((dev_t *)data) = dev2udev(snp->snp_target); break; case FIONBIO: @@ -609,7 +609,7 @@ snp_clone(arg, name, namelen, dev) { int u, i; - if (*dev != NODEV) + if (*dev != NULL) return; if (dev_stdclone(name, NULL, "snp", &u) != 1) return; -- cgit v1.1