diff options
author | phk <phk@FreeBSD.org> | 1999-05-08 06:40:31 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-05-08 06:40:31 +0000 |
commit | 500e41bd7127ee03db75cd2a3704b8025c24e345 (patch) | |
tree | 8dc80d7dc8cd7f629dab45bcd87aa448cb9a4ca0 /sys/kern/tty_cons.c | |
parent | ed809a974db9e6d86dabb993b9b0c6c49e1bbf32 (diff) | |
download | FreeBSD-src-500e41bd7127ee03db75cd2a3704b8025c24e345.zip FreeBSD-src-500e41bd7127ee03db75cd2a3704b8025c24e345.tar.gz |
I got tired of seeing all the cdevsw[major(foo)] all over the place.
Made a new (inline) function devsw(dev_t dev) and substituted it.
Changed to the BDEV variant to this format as well: bdevsw(dev_t dev)
DEVFS will eventually benefit from this change too.
Diffstat (limited to 'sys/kern/tty_cons.c')
-rw-r--r-- | sys/kern/tty_cons.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index 9540125..32b181d 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 - * $Id: cons.c,v 1.63 1999/04/27 12:21:03 phk Exp $ + * $Id: cons.c,v 1.64 1999/04/28 10:52:04 dt Exp $ */ #include "opt_devfs.h" @@ -158,7 +158,7 @@ cninit_finish() /* * Hook the open and close functions. */ - cdp = cdevsw[major(cn_tab->cn_dev)]; + cdp = devsw(cn_tab->cn_dev); cn_phys_close = cdp->d_close; cdp->d_close = cnclose; cn_phys_open = cdp->d_open; @@ -178,7 +178,7 @@ cnuninit(void) /* * Unhook the open and close functions. */ - cdp = cdevsw[major(cn_tab->cn_dev)]; + cdp = devsw(cn_tab->cn_dev); cdp->d_close = cn_phys_close; cn_phys_close = NULL; cdp->d_open = cn_phys_open; @@ -321,7 +321,7 @@ cnread(dev, uio, flag) if ((cn_tab == NULL) || cn_mute) return (0); dev = cn_tab->cn_dev; - return ((*cdevsw[major(dev)]->d_read)(dev, uio, flag)); + return ((*devsw(dev)->d_read)(dev, uio, flag)); } static int @@ -338,7 +338,7 @@ cnwrite(dev, uio, flag) dev = constty->t_dev; else dev = cn_tab->cn_dev; - return ((*cdevsw[major(dev)]->d_write)(dev, uio, flag)); + return ((*devsw(dev)->d_write)(dev, uio, flag)); } static int @@ -365,7 +365,7 @@ cnioctl(dev, cmd, data, flag, p) return (0); } dev = cn_tab->cn_dev; - return ((*cdevsw[major(dev)]->d_ioctl)(dev, cmd, data, flag, p)); + return ((*devsw(dev)->d_ioctl)(dev, cmd, data, flag, p)); } static int @@ -379,7 +379,7 @@ cnpoll(dev, events, p) dev = cn_tab->cn_dev; - return ((*cdevsw[major(dev)]->d_poll)(dev, events, p)); + return ((*devsw(dev)->d_poll)(dev, events, p)); } int |