From 27e8099f0e926d0f6c91734b79913a6c0bdc4149 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Wed, 23 Apr 2003 04:18:18 -0700 Subject: [PATCH] [PATCH] tty cleanups (2/12) Instead of copying tty_driver into tty_struct we put a reference in there. tty->driver turned into a pointer, users updated. Large, but trivial --- arch/cris/drivers/serial.c | 16 +-- arch/ia64/hp/sim/simserial.c | 8 +- arch/mips/au1000/common/serial.c | 12 +-- arch/mips/baget/vacserial.c | 12 +-- arch/mips/kernel/irixioctl.c | 4 +- arch/parisc/kernel/ioctl32.c | 2 +- arch/ppc/4xx_io/serial_sicc.c | 16 +-- arch/ppc/8260_io/uart.c | 12 +-- arch/ppc/8xx_io/uart.c | 12 +-- arch/ppc64/kernel/ioctl32.c | 2 +- arch/sparc64/kernel/ioctl32.c | 2 +- arch/um/drivers/line.c | 6 +- arch/x86_64/ia32/ia32_ioctl.c | 2 +- drivers/bluetooth/hci_ldisc.c | 14 +-- drivers/char/amiserial.c | 12 +-- drivers/char/cyclades.c | 10 +- drivers/char/dz.c | 10 +- drivers/char/epca.c | 24 ++--- drivers/char/esp.c | 12 +-- drivers/char/generic_serial.c | 6 +- drivers/char/hvc_console.c | 2 +- drivers/char/ip2main.c | 8 +- drivers/char/isicom.c | 10 +- drivers/char/istallion.c | 4 +- drivers/char/keyboard.c | 2 +- drivers/char/moxa.c | 10 +- drivers/char/mxser.c | 10 +- drivers/char/n_hdlc.c | 10 +- drivers/char/n_r3964.c | 12 +-- drivers/char/n_tty.c | 44 ++++---- drivers/char/pcmcia/synclink_cs.c | 24 ++--- drivers/char/pcxx.c | 10 +- drivers/char/pty.c | 14 +-- drivers/char/riscom8.c | 8 +- drivers/char/rocket.c | 16 +-- drivers/char/ser_a2232.c | 2 +- drivers/char/serial167.c | 10 +- drivers/char/serial_tx3912.c | 4 +- drivers/char/sh-sci.c | 2 +- drivers/char/specialix.c | 8 +- drivers/char/stallion.c | 4 +- drivers/char/sx.c | 2 +- drivers/char/synclink.c | 24 ++--- drivers/char/synclinkmp.c | 24 ++--- drivers/char/tty_io.c | 156 +++++++++++++-------------- drivers/char/tty_ioctl.c | 36 +++---- drivers/char/vme_scc.c | 2 +- drivers/char/vt.c | 10 +- drivers/input/serio/serport.c | 2 +- drivers/isdn/i4l/isdn_tty.c | 12 +-- drivers/macintosh/macserial.c | 12 +-- drivers/net/hamradio/6pack.c | 34 +++--- drivers/net/hamradio/mkiss.c | 12 +-- drivers/net/irda/irtty-sir.c | 60 +++++------ drivers/net/irda/irtty.c | 34 +++--- drivers/net/ppp_async.c | 6 +- drivers/net/ppp_synctty.c | 6 +- drivers/net/slip.c | 12 +-- drivers/net/wan/pc300_tty.c | 2 +- drivers/net/wan/sdla_chdlc.c | 2 +- drivers/net/wan/x25_asy.c | 10 +- drivers/net/wireless/strip.c | 10 +- drivers/s390/char/con3215.c | 2 +- drivers/s390/net/ctctty.c | 8 +- drivers/sbus/char/aurora.c | 4 +- drivers/serial/68328serial.c | 10 +- drivers/serial/68360serial.c | 12 +-- drivers/serial/core.c | 14 +-- drivers/serial/mcfserial.c | 12 +-- drivers/sgi/char/sgiserial.c | 12 +-- drivers/tc/zs.c | 12 +-- drivers/usb/serial/digi_acceleport.c | 4 +- drivers/usb/serial/whiteheat.c | 4 +- include/linux/tty.h | 2 +- kernel/printk.c | 4 +- net/bluetooth/rfcomm/tty.c | 2 +- net/bridge/netfilter/ebtables.c | 4 +- net/irda/ircomm/ircomm_tty.c | 16 +-- 78 files changed, 499 insertions(+), 499 deletions(-) diff --git a/arch/cris/drivers/serial.c b/arch/cris/drivers/serial.c index 5fb7b45d0e94f..adf717dce819a 100644 --- a/arch/cris/drivers/serial.c +++ b/arch/cris/drivers/serial.c @@ -1402,7 +1402,7 @@ receive_chars(struct e100_serial *info) if (!E100_RTS_GET(info) && CIRC_SPACE(info->recv.head, info->recv.tail, SERIAL_RECV_SIZE) < TTY_THROTTLE_LIMIT) - info->tty->driver.throttle(info->tty); + info->tty->driver->throttle(info->tty); START_FLUSH_FAST_TIMER(info, "receive_chars"); @@ -1658,7 +1658,7 @@ flush_to_flip_buffer(struct e100_serial *info) /* unthrottle if we have throttled */ if (E100_RTS_GET(info) && CIRC_SPACE(info->recv.head, info->recv.tail, SERIAL_RECV_SIZE) > TTY_THROTTLE_LIMIT) - tty->driver.unthrottle(info->tty); + tty->driver->unthrottle(info->tty); } static _INLINE_ void @@ -3049,8 +3049,8 @@ rs_close(struct tty_struct *tty, struct file * filp) #endif shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -3169,7 +3169,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -3289,7 +3289,7 @@ rs_open(struct tty_struct *tty, struct file * filp) /* find which port we want to open */ - line = MINOR(tty->device) - tty->driver.minor_start; + line = MINOR(tty->device) - tty->driver->minor_start; if (line < 0 || line >= NR_PORTS) return -ENODEV; @@ -3303,7 +3303,7 @@ rs_open(struct tty_struct *tty, struct file * filp) #ifdef SERIAL_DEBUG_OPEN printk("[%d] rs_open %s%d, count = %d\n", current->pid, - tty->driver.name, info->line, + tty->driver->name, info->line, info->count); #endif @@ -3359,7 +3359,7 @@ rs_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index f5cedfd3a10b6..dd723bf246541 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c @@ -676,7 +676,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) * the line discipline to only process XON/XOFF characters. */ shutdown(info); - if (tty->driver.flush_buffer) tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); info->event = 0; info->tty = 0; @@ -879,7 +879,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) unsigned long page; MOD_INC_USE_COUNT; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) { MOD_DEC_USE_COUNT; return -ENODEV; @@ -893,7 +893,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) info->tty = tty; #ifdef SIMSERIAL_DEBUG - printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line, info->state->count); #endif info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; @@ -937,7 +937,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) if ((info->state->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->state->normal_termios; else *tty->termios = info->state->callout_termios; diff --git a/arch/mips/au1000/common/serial.c b/arch/mips/au1000/common/serial.c index 8d5d14db8667c..d2d1eb2280d8f 100644 --- a/arch/mips/au1000/common/serial.c +++ b/arch/mips/au1000/common/serial.c @@ -1962,8 +1962,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) rs_wait_until_sent(tty, info->timeout); } shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -2105,7 +2105,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -2264,7 +2264,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) unsigned long page; MOD_INC_USE_COUNT; - line = MINOR(tty->device) - tty->driver.minor_start; + line = MINOR(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) { MOD_DEC_USE_COUNT; return -ENODEV; @@ -2282,7 +2282,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) } #ifdef SERIAL_DEBUG_OPEN - printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line, info->state->count); #endif info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; @@ -2336,7 +2336,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) if ((info->state->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->state->normal_termios; else *tty->termios = info->state->callout_termios; diff --git a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c index 5d3a5374408b2..8d11b469ae9b3 100644 --- a/arch/mips/baget/vacserial.c +++ b/arch/mips/baget/vacserial.c @@ -1717,8 +1717,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) rs_wait_until_sent(tty, info->timeout); } shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1850,7 +1850,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -1997,7 +1997,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) unsigned long page; MOD_INC_USE_COUNT; - line = MINOR(tty->device) - tty->driver.minor_start; + line = MINOR(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) { MOD_DEC_USE_COUNT; return -ENODEV; @@ -2016,7 +2016,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) #ifdef SERIAL_DEBUG_OPEN baget_printk("rs_open %s%d, count = %d\n", - tty->driver.name, info->line, + tty->driver->name, info->line, info->state->count); #endif info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; @@ -2071,7 +2071,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) if ((info->state->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->state->normal_termios; else *tty->termios = info->state->callout_termios; diff --git a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c index e1d446c382ebf..1ad9ad3399c8d 100644 --- a/arch/mips/kernel/irixioctl.c +++ b/arch/mips/kernel/irixioctl.c @@ -48,8 +48,8 @@ static struct tty_struct *get_tty(int fd) static struct tty_struct *get_real_tty(struct tty_struct *tp) { - if (tp->driver.type == TTY_DRIVER_TYPE_PTY && - tp->driver.subtype == PTY_TYPE_MASTER) + if (tp->driver->type == TTY_DRIVER_TYPE_PTY && + tp->driver->subtype == PTY_TYPE_MASTER) return tp->link; else return tp; diff --git a/arch/parisc/kernel/ioctl32.c b/arch/parisc/kernel/ioctl32.c index 2a3b4f0f485b4..62054b4efaa87 100644 --- a/arch/parisc/kernel/ioctl32.c +++ b/arch/parisc/kernel/ioctl32.c @@ -1446,7 +1446,7 @@ static int vt_check(struct file *file) if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl")) return -EINVAL; - if (tty->driver.ioctl != vt_ioctl) + if (tty->driver->ioctl != vt_ioctl) return -EINVAL; /* diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c index e09a211576a1a..a01fef2c69d70 100644 --- a/arch/ppc/4xx_io/serial_sicc.c +++ b/arch/ppc/4xx_io/serial_sicc.c @@ -1053,7 +1053,7 @@ static void siccuart_flush_buffer(struct tty_struct *tty) #if DEBUG printk("siccuart_flush_buffer(%d) called\n", - MINOR(tty->device) - tty->driver.minor_start); + MINOR(tty->device) - tty->driver->minor_start); #endif save_flags(flags); cli(); info->xmit.head = info->xmit.tail = 0; @@ -1482,7 +1482,7 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp) state->count = 1; } if (--state->count < 0) { - printk("rs_close: bad serial port count for %s%d: %d\n", tty->driver.name, info->state->line, state->count); + printk("rs_close: bad serial port count for %s%d: %d\n", tty->driver->name, info->state->line, state->count); state->count = 0; } if (state->count) { @@ -1521,8 +1521,8 @@ static void siccuart_close(struct tty_struct *tty, struct file *filp) siccuart_wait_until_sent(tty, info->timeout); } siccuart_shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1580,7 +1580,7 @@ static void siccuart_wait_until_sent(struct tty_struct *tty, int timeout) expire = jiffies + timeout; #if DEBUG printk("siccuart_wait_until_sent(%d), jiff=%lu, expire=%lu char_time=%lu...\n", - MINOR(tty->device) - tty->driver.minor_start, jiffies, + MINOR(tty->device) - tty->driver->minor_start, jiffies, expire, char_time); #endif while ((readb(info->port->uart_base + BL_SICC_LSR) & _LSR_TX_ALL) != _LSR_TX_ALL) { @@ -1634,7 +1634,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -1754,7 +1754,7 @@ static struct SICC_info *siccuart_get(int line) static int siccuart_open(struct tty_struct *tty, struct file *filp) { struct SICC_info *info; - int retval, line = MINOR(tty->device) - tty->driver.minor_start; + int retval, line = MINOR(tty->device) - tty->driver->minor_start; // is this a line that we've got? @@ -1814,7 +1814,7 @@ static int siccuart_open(struct tty_struct *tty, struct file *filp) if ((info->state->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) { + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) { *tty->termios = info->state->normal_termios; } else { diff --git a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c index a79f85304f196..133ed20eb356c 100644 --- a/arch/ppc/8260_io/uart.c +++ b/arch/ppc/8260_io/uart.c @@ -1701,8 +1701,8 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp) rs_8xx_wait_until_sent(tty, info->timeout); } shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1840,7 +1840,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -1975,7 +1975,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) ser_info_t *info; int retval, line; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) return -ENODEV; retval = get_async_struct(line, &info); @@ -1985,7 +1985,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) return -ENODEV; #ifdef SERIAL_DEBUG_OPEN - printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line, info->state->count); #endif tty->driver_data = info; @@ -2010,7 +2010,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) if ((info->state->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->state->normal_termios; else *tty->termios = info->state->callout_termios; diff --git a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c index 17950803fd9fd..785dd8e3e58f6 100644 --- a/arch/ppc/8xx_io/uart.c +++ b/arch/ppc/8xx_io/uart.c @@ -1750,8 +1750,8 @@ static void rs_8xx_close(struct tty_struct *tty, struct file * filp) rs_8xx_wait_until_sent(tty, info->timeout); } shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1900,7 +1900,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -2035,7 +2035,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) ser_info_t *info; int retval, line; - line = MINOR(tty->device) - tty->driver.minor_start; + line = MINOR(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) return -ENODEV; retval = get_async_struct(line, &info); @@ -2045,7 +2045,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) return -ENODEV; #ifdef SERIAL_DEBUG_OPEN - printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line, info->state->count); #endif tty->driver_data = info; @@ -2071,7 +2071,7 @@ static int rs_8xx_open(struct tty_struct *tty, struct file * filp) if ((info->state->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->state->normal_termios; else *tty->termios = info->state->callout_termios; diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c index 788effdc19a61..beb42d7226968 100644 --- a/arch/ppc64/kernel/ioctl32.c +++ b/arch/ppc64/kernel/ioctl32.c @@ -1799,7 +1799,7 @@ static int vt_check(struct file *file) if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl")) return -EINVAL; - if (tty->driver.ioctl != vt_ioctl) + if (tty->driver->ioctl != vt_ioctl) return -EINVAL; /* diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index c56c269b69d46..97ded6599201b 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -2109,7 +2109,7 @@ static int vt_check(struct file *file) if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl")) return -EINVAL; - if (tty->driver.ioctl != vt_ioctl) + if (tty->driver->ioctl != vt_ioctl) return -EINVAL; /* diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 77acc8cb9588c..5d1f9761e591c 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c @@ -109,7 +109,7 @@ int line_write(struct line *lines, struct tty_struct *tty, int from_user, buf = new; } - i = minor(tty->device) - tty->driver.minor_start; + i = minor(tty->device) - tty->driver->minor_start; line = &lines[i]; down(&line->sem); @@ -219,7 +219,7 @@ int line_open(struct line *lines, struct tty_struct *tty, int n, err = 0; if(tty == NULL) n = 0; - else n = minor(tty->device) - tty->driver.minor_start; + else n = minor(tty->device) - tty->driver->minor_start; line = &lines[n]; down(&line->sem); @@ -267,7 +267,7 @@ void line_close(struct line *lines, struct tty_struct *tty) int n; if(tty == NULL) n = 0; - else n = minor(tty->device) - tty->driver.minor_start; + else n = minor(tty->device) - tty->driver->minor_start; line = &lines[n]; down(&line->sem); diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c index d4369c4f3a22f..3e786a7794595 100644 --- a/arch/x86_64/ia32/ia32_ioctl.c +++ b/arch/x86_64/ia32/ia32_ioctl.c @@ -1987,7 +1987,7 @@ static int vt_check(struct file *file) if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl")) return -EINVAL; - if (tty->driver.ioctl != vt_ioctl) + if (tty->driver->ioctl != vt_ioctl) return -EINVAL; /* diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index bff2dd64af10f..54996f2b7573c 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -145,7 +145,7 @@ restart: int len; set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - len = tty->driver.write(tty, 0, skb->data, skb->len); + len = tty->driver->write(tty, 0, skb->data, skb->len); hdev->stat.byte_tx += len; skb_pull(skb, len); @@ -193,8 +193,8 @@ static int hci_uart_flush(struct hci_dev *hdev) if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) hu->proto->flush(hu); @@ -286,8 +286,8 @@ static int hci_uart_tty_open(struct tty_struct *tty) if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); return 0; } @@ -384,8 +384,8 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const __u8 *data, char hu->hdev.stat.byte_rx += count; spin_unlock(&hu->rx_lock); - if (test_and_clear_bit(TTY_THROTTLED,&tty->flags) && tty->driver.unthrottle) - tty->driver.unthrottle(tty); + if (test_and_clear_bit(TTY_THROTTLED,&tty->flags) && tty->driver->unthrottle) + tty->driver->unthrottle(tty); } static int hci_uart_register_dev(struct hci_uart *hu) diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 187b8434fb693..b3e154117184f 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -1598,8 +1598,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) rs_wait_until_sent(tty, info->timeout); } shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1741,7 +1741,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -1895,7 +1895,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) unsigned long page; MOD_INC_USE_COUNT; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) { MOD_DEC_USE_COUNT; return -ENODEV; @@ -1911,7 +1911,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) return -ENODEV; #ifdef SERIAL_DEBUG_OPEN - printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line, info->state->count); #endif info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; @@ -1961,7 +1961,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) if ((info->state->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->state->normal_termios; else *tty->termios = info->state->callout_termios; diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index fcd7cd1bda7c1..ac41f703148a6 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -2378,7 +2378,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE){ return -EBUSY; } @@ -2579,7 +2579,7 @@ cy_open(struct tty_struct *tty, struct file * filp) unsigned long page; MOD_INC_USE_COUNT; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (NR_PORTS <= line)){ MOD_DEC_USE_COUNT; return -ENODEV; @@ -2683,7 +2683,7 @@ cy_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; @@ -2904,8 +2904,8 @@ cy_close(struct tty_struct *tty, struct file *filp) CY_UNLOCK(info, flags); shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); CY_LOCK(info, flags); diff --git a/drivers/char/dz.c b/drivers/char/dz.c index db281901522d6..a3bf3db620a93 100644 --- a/drivers/char/dz.c +++ b/drivers/char/dz.c @@ -1112,8 +1112,8 @@ static void dz_close(struct tty_struct *tty, struct file *filp) */ shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer (tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer (tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer (tty); tty->closing = 0; @@ -1183,7 +1183,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & DZ_NORMAL_ACTIVE) return -EBUSY; @@ -1271,7 +1271,7 @@ static int dz_open (struct tty_struct *tty, struct file *filp) struct dz_serial *info; int retval, line; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; /* * The dz lines for the mouse/keyboard must be opened using their @@ -1301,7 +1301,7 @@ static int dz_open (struct tty_struct *tty, struct file *filp) return retval; if ((info->count == 1) && (info->flags & DZ_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/char/epca.c b/drivers/char/epca.c index de7ed6c425396..1992ab437f0aa 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -503,7 +503,7 @@ static void pc_close(struct tty_struct * tty, struct file * filp) struct channel *ch; unsigned long flags; - if (tty->driver.subtype == SERIAL_TYPE_INFO) + if (tty->driver->subtype == SERIAL_TYPE_INFO) { return; } @@ -574,8 +574,8 @@ static void pc_close(struct tty_struct * tty, struct file * filp) tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */ } - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -681,8 +681,8 @@ static void pc_hangup(struct tty_struct *tty) save_flags(flags); cli(); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -729,7 +729,7 @@ static int pc_write(struct tty_struct * tty, int from_user, /* Stop users from hurting themselves on control minor */ - if (tty->driver.subtype == SERIAL_TYPE_INFO) + if (tty->driver->subtype == SERIAL_TYPE_INFO) { return (0) ; } @@ -1238,7 +1238,7 @@ static int block_til_ready(struct tty_struct *tty, device isn't being used. -------------------------------------------------------------------- */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { /* A cud device has been opened */ if (ch->asyncflags & ASYNC_NORMAL_ACTIVE) return -EBUSY; @@ -1368,12 +1368,12 @@ static int pc_open(struct tty_struct *tty, struct file * filp) /* Nothing "real" happens in open of control device */ - if (tty->driver.subtype == SERIAL_TYPE_INFO) + if (tty->driver->subtype == SERIAL_TYPE_INFO) { return (0) ; } - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if (line < 0 || line >= nbdevs) { printk(KERN_ERR " - pc_open : line out of range in pc_open\n"); @@ -1453,7 +1453,7 @@ static int pc_open(struct tty_struct *tty, struct file * filp) /* Should this be here except for SPLIT termios ? */ if (ch->count == 1) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = ch->normal_termios; else *tty->termios = ch->callout_termios; @@ -2712,7 +2712,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch) the driver will wait on carrier detect. ------------------------------------------------------------------- */ - if ((ts->c_cflag & CLOCAL) || (tty->driver.subtype == SERIAL_TYPE_CALLOUT)) + if ((ts->c_cflag & CLOCAL) || (tty->driver->subtype == SERIAL_TYPE_CALLOUT)) { /* Begin it is a cud device or a ttyD device with CLOCAL on */ ch->asyncflags &= ~ASYNC_CHECK_CD; } /* End it is a cud device or a ttyD device with CLOCAL on */ @@ -2960,7 +2960,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file, struct channel *ch = (struct channel *) tty->driver_data; /* The control device has it's own set of commands */ - if (tty->driver.subtype == SERIAL_TYPE_INFO) + if (tty->driver->subtype == SERIAL_TYPE_INFO) { /* Begin if subtype is the control device */ switch (cmd) diff --git a/drivers/char/esp.c b/drivers/char/esp.c index 3f5021d4b86fc..59391d5dcbe9b 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c @@ -2112,8 +2112,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) rs_wait_until_sent(tty, info->timeout); } shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -2226,7 +2226,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -2354,7 +2354,7 @@ static int esp_open(struct tty_struct *tty, struct file * filp) struct esp_struct *info; int retval, line; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) return -ENODEV; @@ -2371,7 +2371,7 @@ static int esp_open(struct tty_struct *tty, struct file * filp) } #ifdef SERIAL_DEBUG_OPEN - printk("esp_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("esp_open %s%d, count = %d\n", tty->driver->name, info->line, info->count); #endif MOD_INC_USE_COUNT; @@ -2402,7 +2402,7 @@ static int esp_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index a29bf19fdf384..67ae488451d29 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c @@ -622,7 +622,7 @@ int gs_block_til_ready(void *port_, struct file * filp) * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == GS_TYPE_CALLOUT) { + if (tty->driver->subtype == GS_TYPE_CALLOUT) { if (port->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((port->flags & ASYNC_CALLOUT_ACTIVE) && @@ -794,8 +794,8 @@ void gs_close(struct tty_struct * tty, struct file * filp) port->flags &= ~GS_ACTIVE; - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index 1bf93044b78b8..72f71fd6109c2 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c @@ -69,7 +69,7 @@ struct hvc_struct hvc_struct[MAX_NR_HVC_CONSOLES]; static int hvc_open(struct tty_struct *tty, struct file * filp) { - int line = minor(tty->device) - tty->driver.minor_start; + int line = minor(tty->device) - tty->driver->minor_start; struct hvc_struct *hp; unsigned long flags; diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c index 45aed6f25cf46..f071fdb3411a0 100644 --- a/drivers/char/ip2main.c +++ b/drivers/char/ip2main.c @@ -1616,7 +1616,7 @@ ip2_open( PTTY tty, struct file *pFile ) * (These are the only tests the standard serial driver makes for * callout devices.) */ - if ( tty->driver.subtype == SERIAL_TYPE_CALLOUT ) { + if ( tty->driver->subtype == SERIAL_TYPE_CALLOUT ) { if ( pCh->flags & ASYNC_NORMAL_ACTIVE ) { return -EBUSY; } @@ -1719,7 +1719,7 @@ noblock: if ( tty->count == 1 ) { i2QueueCommands(PTYPE_INLINE, pCh, 0, 2, CMD_CTSFL_DSAB, CMD_RTSFL_DSAB); if ( pCh->flags & ASYNC_SPLIT_TERMIOS ) { - if ( tty->driver.subtype == SERIAL_TYPE_NORMAL ) { + if ( tty->driver->subtype == SERIAL_TYPE_NORMAL ) { *tty->termios = pCh->NormalTermios; } else { *tty->termios = pCh->CalloutTermios; @@ -1827,8 +1827,8 @@ ip2_close( PTTY tty, struct file *pFile ) serviceOutgoingFifo ( pCh->pMyBord ); - if ( tty->driver.flush_buffer ) - tty->driver.flush_buffer(tty); + if ( tty->driver->flush_buffer ) + tty->driver->flush_buffer(tty); if ( tty->ldisc.flush_buffer ) tty->ldisc.flush_buffer(tty); tty->closing = 0; diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 11851a8ad1e43..3140e956ee37d 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c @@ -907,7 +907,7 @@ static int block_til_ready(struct tty_struct * tty, struct file * filp, struct i /* trying to open a callout device... check for constraints */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISICOM: bl_ti_rdy: callout open.\n"); #endif @@ -1021,7 +1021,7 @@ static int isicom_open(struct tty_struct * tty, struct file * filp) #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISICOM: open start!!!.\n"); #endif - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; #ifdef ISICOM_DEBUG printk(KERN_DEBUG "line = %d.\n", line); @@ -1072,7 +1072,7 @@ static int isicom_open(struct tty_struct * tty, struct file * filp) return error; if ((port->count == 1) && (port->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = port->normal_termios; else *tty->termios = port->callout_termios; @@ -1196,8 +1196,8 @@ static void isicom_close(struct tty_struct * tty, struct file * filp) outw(card->port_status, card->base + 0x02); } isicom_shutdown_port(port); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index f093d3f983871..5211ec885d842 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c @@ -1115,7 +1115,7 @@ static int stli_open(struct tty_struct *tty, struct file *filp) * previous opens still in effect. If we are a normal serial device * then also we might have to wait for carrier. */ - if (tty->driver.subtype == STL_DRVTYPCALLOUT) { + if (tty->driver->subtype == STL_DRVTYPCALLOUT) { if (portp->flags & ASYNC_NORMAL_ACTIVE) return(-EBUSY); if (portp->flags & ASYNC_CALLOUT_ACTIVE) { @@ -1139,7 +1139,7 @@ static int stli_open(struct tty_struct *tty, struct file *filp) } if ((portp->refcount == 1) && (portp->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == STL_DRVTYPSERIAL) + if (tty->driver->subtype == STL_DRVTYPSERIAL) *tty->termios = portp->normaltermios; else *tty->termios = portp->callouttermios; diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index ef1fd1b6b0df5..dd9b1dd4e828b 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -1089,7 +1089,7 @@ void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs) clear_bit(keycode, key_down); if (rep && (!vc_kbd_mode(kbd, VC_REPEAT) || (tty && - (!L_ECHO(tty) && tty->driver.chars_in_buffer(tty))))) { + (!L_ECHO(tty) && tty->driver->chars_in_buffer(tty))))) { /* * Don't repeat a key if the input buffers are not empty and the * characters get aren't echoed locally. This makes key repeat diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index dc5f93e403956..f3f7a71e05063 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c @@ -189,7 +189,7 @@ static struct mxser_mstatus GMStatus[MAX_PORTS]; #define WAKEUP_CHARS 256 -#define PORTNO(x) (minor((x)->device) - (x)->driver.minor_start) +#define PORTNO(x) (minor((x)->device) - (x)->driver->minor_start) static int verbose = 0; static int ttymajor = MOXAMAJOR; @@ -585,7 +585,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) tty->driver_data = ch; ch->tty = tty; if (ch->count == 1 && (ch->asyncflags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = ch->normal_termios; else *tty->termios = ch->callout_termios; @@ -671,8 +671,8 @@ static void moxa_close(struct tty_struct *tty, struct file *filp) shut_down(ch); MoxaPortFlushData(port, 2); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1094,7 +1094,7 @@ static int block_till_ready(struct tty_struct *tty, struct file *filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (ch->asyncflags & ASYNC_NORMAL_ACTIVE) return (-EBUSY); if ((ch->asyncflags & ASYNC_CALLOUT_ACTIVE) && diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index f5bb6a2d49994..56f397efc8a62 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -94,7 +94,7 @@ #define UART_MCR_AFE 0x20 #define UART_LSR_SPECIAL 0x1E -#define PORTNO(x) (minor((x)->device) - (x)->driver.minor_start) +#define PORTNO(x) (minor((x)->device) - (x)->driver->minor_start) #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) @@ -758,7 +758,7 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) return (retval); if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; @@ -862,8 +862,8 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) } } mxser_shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1574,7 +1574,7 @@ static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return (-EBUSY); if ((info->flags & ASYNC_CALLOUT_ACTIVE) && diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c index 4bebe76f0f8b1..6e8198c4988ba 100644 --- a/drivers/char/n_hdlc.c +++ b/drivers/char/n_hdlc.c @@ -348,8 +348,8 @@ static int n_hdlc_tty_open (struct tty_struct *tty) if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer (tty); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer (tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer (tty); if (debuglevel >= DEBUG_LEVEL_INFO) printk("%s(%d)n_hdlc_tty_open() success\n",__FILE__,__LINE__); @@ -403,7 +403,7 @@ static void n_hdlc_send_frames (struct n_hdlc *n_hdlc, struct tty_struct *tty) /* Send the next block of data to device */ tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = tty->driver.write(tty, 0, tbuf->buf, tbuf->count); + actual = tty->driver->write(tty, 0, tbuf->buf, tbuf->count); /* if transmit error, throw frame away by */ /* pretending it was accepted by driver */ @@ -780,8 +780,8 @@ static int n_hdlc_tty_ioctl (struct tty_struct *tty, struct file * file, case TIOCOUTQ: /* get the pending tx byte count in the driver */ - count = tty->driver.chars_in_buffer ? - tty->driver.chars_in_buffer(tty) : 0; + count = tty->driver->chars_in_buffer ? + tty->driver->chars_in_buffer(tty) : 0; /* add size of next output frame in queue */ spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlock,flags); if (n_hdlc->tx_buf_list.head) diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c index 06801b2dc8dfa..36b6eab356d0e 100644 --- a/drivers/char/n_r3964.c +++ b/drivers/char/n_r3964.c @@ -418,9 +418,9 @@ static void put_char(struct r3964_info *pInfo, unsigned char ch) if(tty==NULL) return; - if(tty->driver.put_char) + if(tty->driver->put_char) { - tty->driver.put_char(tty, ch); + tty->driver->put_char(tty, ch); } pInfo->bcc ^= ch; } @@ -432,9 +432,9 @@ static void flush(struct r3964_info *pInfo) if(tty==NULL) return; - if(tty->driver.flush_chars) + if(tty->driver->flush_chars) { - tty->driver.flush_chars(tty); + tty->driver->flush_chars(tty); } } @@ -507,8 +507,8 @@ static void transmit_block(struct r3964_info *pInfo) return; } - if(tty->driver.write_room) - room=tty->driver.write_room(tty); + if(tty->driver->write_room) + room=tty->driver->write_room(tty); TRACE_PS("transmit_block %x, room %d, length %d", (int)pBlock, room, pBlock->length); diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index d39dcbc95cebb..41b3cd51cf3a5 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -117,8 +117,8 @@ static void check_unthrottle(struct tty_struct * tty) { if (tty->count && test_and_clear_bit(TTY_THROTTLED, &tty->flags) && - tty->driver.unthrottle) - tty->driver.unthrottle(tty); + tty->driver->unthrottle) + tty->driver->unthrottle(tty); } /* @@ -183,7 +183,7 @@ static int opost(unsigned char c, struct tty_struct *tty) { int space, spaces; - space = tty->driver.write_room(tty); + space = tty->driver->write_room(tty); if (!space) return -1; @@ -195,7 +195,7 @@ static int opost(unsigned char c, struct tty_struct *tty) if (O_ONLCR(tty)) { if (space < 2) return -1; - tty->driver.put_char(tty, '\r'); + tty->driver->put_char(tty, '\r'); tty->column = 0; } tty->canon_column = tty->column; @@ -217,7 +217,7 @@ static int opost(unsigned char c, struct tty_struct *tty) if (space < spaces) return -1; tty->column += spaces; - tty->driver.write(tty, 0, " ", spaces); + tty->driver->write(tty, 0, " ", spaces); return 0; } tty->column += spaces; @@ -234,7 +234,7 @@ static int opost(unsigned char c, struct tty_struct *tty) break; } } - tty->driver.put_char(tty, c); + tty->driver->put_char(tty, c); return 0; } @@ -250,7 +250,7 @@ static ssize_t opost_block(struct tty_struct * tty, int i; char *cp; - space = tty->driver.write_room(tty); + space = tty->driver->write_room(tty); if (!space) return 0; if (nr > space) @@ -296,9 +296,9 @@ static ssize_t opost_block(struct tty_struct * tty, } } break_out: - if (tty->driver.flush_chars) - tty->driver.flush_chars(tty); - i = tty->driver.write(tty, 0, buf, i); + if (tty->driver->flush_chars) + tty->driver->flush_chars(tty); + i = tty->driver->write(tty, 0, buf, i); return i; } @@ -306,7 +306,7 @@ break_out: static inline void put_char(unsigned char c, struct tty_struct *tty) { - tty->driver.put_char(tty, c); + tty->driver->put_char(tty, c); } /* Must be called only when L_ECHO(tty) is true. */ @@ -452,8 +452,8 @@ static inline void isig(int sig, struct tty_struct *tty, int flush) kill_pg(tty->pgrp, sig, 1); if (flush || !L_NOFLSH(tty)) { n_tty_flush_buffer(tty); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); } } @@ -782,8 +782,8 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, break; } } - if (tty->driver.flush_chars) - tty->driver.flush_chars(tty); + if (tty->driver->flush_chars) + tty->driver->flush_chars(tty); } if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) { @@ -800,8 +800,8 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, if (n_tty_receive_room(tty) < TTY_THRESHOLD_THROTTLE) { /* check TTY_THROTTLED first so it indicates our state */ if (!test_and_set_bit(TTY_THROTTLED, &tty->flags) && - tty->driver.throttle) - tty->driver.throttle(tty); + tty->driver->throttle) + tty->driver->throttle(tty); } } @@ -869,7 +869,7 @@ static void n_tty_set_termios(struct tty_struct *tty, struct termios * old) tty->raw = 1; if ((I_IGNBRK(tty) || (!I_BRKINT(tty) && !I_PARMRK(tty))) && (I_IGNPAR(tty) || !I_INPCK(tty)) && - (tty->driver.flags & TTY_DRIVER_REAL_RAW)) + (tty->driver->flags & TTY_DRIVER_REAL_RAW)) tty->real_raw = 1; else tty->real_raw = 0; @@ -1205,10 +1205,10 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file, break; b++; nr--; } - if (tty->driver.flush_chars) - tty->driver.flush_chars(tty); + if (tty->driver->flush_chars) + tty->driver->flush_chars(tty); } else { - c = tty->driver.write(tty, 1, b, nr); + c = tty->driver->write(tty, 1, b, nr); if (c < 0) { retval = c; goto break_out; @@ -1251,7 +1251,7 @@ static unsigned int normal_poll(struct tty_struct * tty, struct file * file, pol else tty->minimum_to_wake = 1; } - if (tty->driver.chars_in_buffer(tty) < WAKEUP_CHARS) + if (tty->driver->chars_in_buffer(tty) < WAKEUP_CHARS) mask |= POLLOUT | POLLWRNORM; return mask; } diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index ee522fa8d2cd2..c2d58fd49aa6e 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -2516,7 +2516,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct termios *old_termi if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgslpc_set_termios %s\n", __FILE__,__LINE__, - tty->driver.name ); + tty->driver->name ); /* just return if nothing has changed */ if ((tty->termios->c_cflag == old_termios->c_cflag) @@ -2615,8 +2615,8 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp) if (info->flags & ASYNC_INITIALIZED) mgslpc_wait_until_sent(tty, info->timeout); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -2642,7 +2642,7 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp) cleanup: if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgslpc_close(%s) exit, count=%d\n", __FILE__,__LINE__, - tty->driver.name, info->count); + tty->driver->name, info->count); } /* Wait until the transmitter is empty. @@ -2747,9 +2747,9 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):block_til_ready on %s\n", - __FILE__,__LINE__, tty->driver.name ); + __FILE__,__LINE__, tty->driver->name ); - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { /* this is a callout device */ /* just verify that normal device is not in use */ if (info->flags & ASYNC_NORMAL_ACTIVE) @@ -2795,7 +2795,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):block_til_ready before block on %s count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); spin_lock_irqsave(&info->lock, flags); if (!tty_hung_up_p(filp)) { @@ -2839,7 +2839,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):block_til_ready blocking on %s count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); schedule(); } @@ -2853,7 +2853,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):block_til_ready after blocking on %s count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); if (!retval) info->flags |= ASYNC_NORMAL_ACTIVE; @@ -2868,7 +2868,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) unsigned long flags; /* verify range of specified line number */ - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= mgslpc_device_count)) { printk("%s(%d):mgslpc_open with illegal line #%d.\n", __FILE__,__LINE__,line); @@ -2892,7 +2892,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgslpc_open(%s), old ref count = %d\n", - __FILE__,__LINE__,tty->driver.name, info->count); + __FILE__,__LINE__,tty->driver->name, info->count); /* If port is closing, signal caller to try again */ if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){ @@ -2931,7 +2931,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp) if ((info->count == 1) && info->flags & ASYNC_SPLIT_TERMIOS) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/char/pcxx.c b/drivers/char/pcxx.c index a510ba66d6efe..200660e3101a9 100644 --- a/drivers/char/pcxx.c +++ b/drivers/char/pcxx.c @@ -405,7 +405,7 @@ int pcxe_open(struct tty_struct *tty, struct file * filp) int boardnum; int retval; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if(line < 0 || line >= nbdevs) { printk("line out of range in pcxe_open\n"); @@ -482,7 +482,7 @@ int pcxe_open(struct tty_struct *tty, struct file * filp) * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (ch->asyncflags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if (ch->asyncflags & ASYNC_CALLOUT_ACTIVE) { @@ -517,7 +517,7 @@ int pcxe_open(struct tty_struct *tty, struct file * filp) save_flags(flags); cli(); if((ch->count == 1) && (ch->asyncflags & ASYNC_SPLIT_TERMIOS)) { - if(tty->driver.subtype == SERIAL_TYPE_NORMAL) + if(tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = ch->normal_termios; else *tty->termios = ch->callout_termios; @@ -617,8 +617,8 @@ static void pcxe_close(struct tty_struct * tty, struct file * filp) tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */ } - if(tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if(tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if(tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); shutdown(info); diff --git a/drivers/char/pty.c b/drivers/char/pty.c index c7a5300d47478..45e62e6cf165a 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -68,7 +68,7 @@ static void pty_close(struct tty_struct * tty, struct file * filp) { if (!tty) return; - if (tty->driver.subtype == PTY_TYPE_MASTER) { + if (tty->driver->subtype == PTY_TYPE_MASTER) { if (tty->count > 1) printk("master pty_close: count = %d!!\n", tty->count); } else { @@ -84,14 +84,14 @@ static void pty_close(struct tty_struct * tty, struct file * filp) wake_up_interruptible(&tty->link->read_wait); wake_up_interruptible(&tty->link->write_wait); set_bit(TTY_OTHER_CLOSED, &tty->link->flags); - if (tty->driver.subtype == PTY_TYPE_MASTER) { + if (tty->driver->subtype == PTY_TYPE_MASTER) { set_bit(TTY_OTHER_CLOSED, &tty->flags); #ifdef CONFIG_UNIX98_PTYS { unsigned int major = major(tty->device) - UNIX98_PTY_MASTER_MAJOR; if ( major < UNIX98_NR_MAJORS ) { devpts_pty_kill( minor(tty->device) - - tty->driver.minor_start + tty->driver.name_base ); + - tty->driver->minor_start + tty->driver->name_base ); } } #endif @@ -220,7 +220,7 @@ static int pty_chars_in_buffer(struct tty_struct *tty) /* The ldisc must report 0 if no characters available to be read */ count = to->ldisc.chars_in_buffer(to); - if (tty->driver.subtype == PTY_TYPE_SLAVE) return count; + if (tty->driver->subtype == PTY_TYPE_SLAVE) return count; /* Master side driver ... if the other side's read buffer is less than * half full, return 0 to allow writers to proceed; otherwise return @@ -239,7 +239,7 @@ static int pty_chars_in_buffer(struct tty_struct *tty) static int pty_get_device_number(struct tty_struct *tty, unsigned int *value) { unsigned int result = minor(tty->device) - - tty->driver.minor_start + tty->driver.name_base; + - tty->driver->minor_start + tty->driver->name_base; return put_user(result, value); } #endif @@ -313,10 +313,10 @@ static int pty_open(struct tty_struct *tty, struct file * filp) retval = -ENODEV; if (!tty || !tty->link) goto out; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PTYS)) goto out; - pty = (struct pty_struct *)(tty->driver.driver_state) + line; + pty = (struct pty_struct *)(tty->driver->driver_state) + line; tty->driver_data = pty; retval = -EIO; diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index 1522f1f82f9fd..9444ca8dec475 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c @@ -991,7 +991,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == RISCOM_TYPE_CALLOUT) { + if (tty->driver->subtype == RISCOM_TYPE_CALLOUT) { if (port->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((port->flags & ASYNC_CALLOUT_ACTIVE) && @@ -1112,7 +1112,7 @@ static int rc_open(struct tty_struct * tty, struct file * filp) return error; if ((port->count == 1) && (port->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == RISCOM_TYPE_NORMAL) + if (tty->driver->subtype == RISCOM_TYPE_NORMAL) *tty->termios = port->normal_termios; else *tty->termios = port->callout_termios; @@ -1198,8 +1198,8 @@ static void rc_close(struct tty_struct * tty, struct file * filp) } } rc_shutdown_port(bp, port); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 5c3b4b600761e..b16c7e40b82fb 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -710,7 +710,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ROCKET_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ROCKET_CALLOUT_ACTIVE) && @@ -822,7 +822,7 @@ static int rp_open(struct tty_struct *tty, struct file * filp) CHANNEL_t *cp; unsigned long page; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= MAX_RP_PORTS)) return -ENODEV; if (!tmp_buf) { @@ -946,7 +946,7 @@ static int rp_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ROCKET_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; @@ -1048,8 +1048,8 @@ static void rp_close(struct tty_struct *tty, struct file * filp) if (C_HUPCL(tty)) { sClrDTR(cp); } - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -1329,9 +1329,9 @@ static int rp_ioctl(struct tty_struct *tty, struct file * file, static char *rp_tty_name(struct tty_struct *tty, char *buf) { if (tty) - sprintf(buf, "%s%d", tty->driver.name, - minor(tty->device) - tty->driver.minor_start + - tty->driver.name_base); + sprintf(buf, "%s%d", tty->driver->name, + minor(tty->device) - tty->driver->minor_start + + tty->driver->name_base); else strcpy(buf, "NULL tty"); return buf; diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c index 889f13f6abb18..a82a3b925594e 100644 --- a/drivers/char/ser_a2232.c +++ b/drivers/char/ser_a2232.c @@ -480,7 +480,7 @@ static int a2232_open(struct tty_struct * tty, struct file * filp) } if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)){ - if (tty->driver.subtype == A2232_TTY_SUBTYPE_NORMAL) + if (tty->driver->subtype == A2232_TTY_SUBTYPE_NORMAL) *tty->termios = port->gs.normal_termios; else *tty->termios = port->gs.callout_termios; diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 1800ea9984dd3..9d8f411972fd2 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -1913,8 +1913,8 @@ cy_close(struct tty_struct * tty, struct file * filp) if (info->flags & ASYNC_INITIALIZED) tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */ shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); info->event = 0; @@ -2008,7 +2008,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE){ return -EBUSY; } @@ -2133,7 +2133,7 @@ cy_open(struct tty_struct *tty, struct file * filp) int retval, line; /* CP('O'); */ - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (NR_PORTS <= line)){ return -ENODEV; } @@ -2165,7 +2165,7 @@ cy_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/char/serial_tx3912.c b/drivers/char/serial_tx3912.c index ded61de976d2f..d13725ed1ceb5 100644 --- a/drivers/char/serial_tx3912.c +++ b/drivers/char/serial_tx3912.c @@ -547,7 +547,7 @@ static int rs_open (struct tty_struct * tty, struct file * filp) return -EIO; } - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; rs_dprintk (TX3912_UART_DEBUG_OPEN, "%d: opening line %d. tty=%p ctty=%p)\n", (int) current->pid, line, tty, current->tty); @@ -602,7 +602,7 @@ static int rs_open (struct tty_struct * tty, struct file * filp) /* tty->low_latency = 1; */ if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = port->gs.normal_termios; else *tty->termios = port->gs.callout_termios; diff --git a/drivers/char/sh-sci.c b/drivers/char/sh-sci.c index 8126a71d0b0b3..1cfe4c4cde954 100644 --- a/drivers/char/sh-sci.c +++ b/drivers/char/sh-sci.c @@ -853,7 +853,7 @@ static int sci_open(struct tty_struct * tty, struct file * filp) } if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = port->gs.normal_termios; else *tty->termios = port->gs.callout_termios; diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 98b3dbb07e74d..cdb9f2993313b 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -1349,7 +1349,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SPECIALIX_TYPE_CALLOUT) { + if (tty->driver->subtype == SPECIALIX_TYPE_CALLOUT) { if (port->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((port->flags & ASYNC_CALLOUT_ACTIVE) && @@ -1484,7 +1484,7 @@ static int sx_open(struct tty_struct * tty, struct file * filp) return error; if ((port->count == 1) && (port->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SPECIALIX_TYPE_NORMAL) + if (tty->driver->subtype == SPECIALIX_TYPE_NORMAL) *tty->termios = port->normal_termios; else *tty->termios = port->callout_termios; @@ -1576,8 +1576,8 @@ static void sx_close(struct tty_struct * tty, struct file * filp) } sx_shutdown_port(bp, port); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index 141c03bf98446..9a18f77e22a5d 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c @@ -1090,7 +1090,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp) * previous opens still in effect. If we are a normal serial device * then also we might have to wait for carrier. */ - if (tty->driver.subtype == STL_DRVTYPCALLOUT) { + if (tty->driver->subtype == STL_DRVTYPCALLOUT) { if (portp->flags & ASYNC_NORMAL_ACTIVE) return(-EBUSY); if (portp->flags & ASYNC_CALLOUT_ACTIVE) { @@ -1114,7 +1114,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp) } if ((portp->refcount == 1) && (portp->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == STL_DRVTYPSERIAL) + if (tty->driver->subtype == STL_DRVTYPSERIAL) *tty->termios = portp->normaltermios; else *tty->termios = portp->callouttermios; diff --git a/drivers/char/sx.c b/drivers/char/sx.c index fca096a23b4d1..871a81b694cf7 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -1500,7 +1500,7 @@ static int sx_open (struct tty_struct * tty, struct file * filp) /* tty->low_latency = 1; */ if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = port->gs.normal_termios; else *tty->termios = port->gs.callout_termios; diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 6e76e67aa9e46..b73a13abbf813 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -3125,7 +3125,7 @@ static void mgsl_set_termios(struct tty_struct *tty, struct termios *old_termios if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgsl_set_termios %s\n", __FILE__,__LINE__, - tty->driver.name ); + tty->driver->name ); /* just return if nothing has changed */ if ((tty->termios->c_cflag == old_termios->c_cflag) @@ -3237,8 +3237,8 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp) if (info->flags & ASYNC_INITIALIZED) mgsl_wait_until_sent(tty, info->timeout); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -3264,7 +3264,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp) cleanup: if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgsl_close(%s) exit, count=%d\n", __FILE__,__LINE__, - tty->driver.name, info->count); + tty->driver->name, info->count); } /* end of mgsl_close() */ @@ -3397,9 +3397,9 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):block_til_ready on %s\n", - __FILE__,__LINE__, tty->driver.name ); + __FILE__,__LINE__, tty->driver->name ); - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { /* this is a callout device */ /* just verify that normal device is not in use */ if (info->flags & ASYNC_NORMAL_ACTIVE) @@ -3445,7 +3445,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):block_til_ready before block on %s count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); spin_lock_irqsave(&info->irq_spinlock, flags); if (!tty_hung_up_p(filp)) { @@ -3489,7 +3489,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):block_til_ready blocking on %s count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); schedule(); } @@ -3503,7 +3503,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):block_til_ready after blocking on %s count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); if (!retval) info->flags |= ASYNC_NORMAL_ACTIVE; @@ -3530,7 +3530,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp) unsigned long flags; /* verify range of specified line number */ - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= mgsl_device_count)) { printk("%s(%d):mgsl_open with illegal line #%d.\n", __FILE__,__LINE__,line); @@ -3554,7 +3554,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp) if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgsl_open(%s), old ref count = %d\n", - __FILE__,__LINE__,tty->driver.name, info->count); + __FILE__,__LINE__,tty->driver->name, info->count); /* If port is closing, signal caller to try again */ if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){ @@ -3605,7 +3605,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp) if ((info->count == 1) && info->flags & ASYNC_SPLIT_TERMIOS) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index d413d33416cb6..d93f638737765 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c @@ -740,7 +740,7 @@ static int open(struct tty_struct *tty, struct file *filp) int retval, line; unsigned long flags; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= synclinkmp_device_count)) { printk("%s(%d): open with illegal line #%d.\n", __FILE__,__LINE__,line); @@ -769,7 +769,7 @@ static int open(struct tty_struct *tty, struct file *filp) if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s open(), old ref count = %d\n", - __FILE__,__LINE__,tty->driver.name, info->count); + __FILE__,__LINE__,tty->driver->name, info->count); /* If port is closing, signal caller to try again */ if (tty_hung_up_p(filp) || info->flags & ASYNC_CLOSING){ @@ -808,7 +808,7 @@ static int open(struct tty_struct *tty, struct file *filp) if ((info->count == 1) && info->flags & ASYNC_SPLIT_TERMIOS) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; @@ -895,8 +895,8 @@ static void close(struct tty_struct *tty, struct file *filp) if (info->flags & ASYNC_INITIALIZED) wait_until_sent(tty, info->timeout); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -922,7 +922,7 @@ static void close(struct tty_struct *tty, struct file *filp) cleanup: if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s close() exit, count=%d\n", __FILE__,__LINE__, - tty->driver.name, info->count); + tty->driver->name, info->count); } /* Called by tty_hangup() when a hangup is signaled. @@ -958,7 +958,7 @@ static void set_termios(struct tty_struct *tty, struct termios *old_termios) if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s set_termios()\n", __FILE__,__LINE__, - tty->driver.name ); + tty->driver->name ); /* just return if nothing has changed */ if ((tty->termios->c_cflag == old_termios->c_cflag) @@ -3199,9 +3199,9 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s block_til_ready()\n", - __FILE__,__LINE__, tty->driver.name ); + __FILE__,__LINE__, tty->driver->name ); - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { /* this is a callout device */ /* just verify that normal device is not in use */ if (info->flags & ASYNC_NORMAL_ACTIVE) @@ -3247,7 +3247,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s block_til_ready() before block, count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); spin_lock_irqsave(&info->lock, flags); if (!tty_hung_up_p(filp)) { @@ -3291,7 +3291,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s block_til_ready() count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); schedule(); } @@ -3305,7 +3305,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):%s block_til_ready() after, count=%d\n", - __FILE__,__LINE__, tty->driver.name, info->count ); + __FILE__,__LINE__, tty->driver->name, info->count ); if (!retval) info->flags |= ASYNC_NORMAL_ACTIVE; diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 3310d687c4bf9..225c3989bae7f 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -178,23 +178,23 @@ static inline void free_tty_struct(struct tty_struct *tty) static char * _tty_make_name(struct tty_struct *tty, const char *name, char *buf) { - int idx = (tty)? minor(tty->device) - tty->driver.minor_start:0; + int idx = (tty)? minor(tty->device) - tty->driver->minor_start:0; if (!tty) /* Hmm. NULL pointer. That's fun. */ strcpy(buf, "NULL tty"); else sprintf(buf, name, - idx + tty->driver.name_base); + idx + tty->driver->name_base); return buf; } -#define TTY_NUMBER(tty) (minor((tty)->device) - (tty)->driver.minor_start + \ - (tty)->driver.name_base) +#define TTY_NUMBER(tty) (minor((tty)->device) - (tty)->driver->minor_start + \ + (tty)->driver->name_base) char *tty_name(struct tty_struct *tty, char *buf) { - return _tty_make_name(tty, (tty)?tty->driver.name:NULL, buf); + return _tty_make_name(tty, (tty)?tty->driver->name:NULL, buf); } EXPORT_SYMBOL(tty_name); @@ -231,8 +231,8 @@ static int check_tty_count(struct tty_struct *tty, const char *routine) count++; } file_list_unlock(); - if (tty->driver.type == TTY_DRIVER_TYPE_PTY && - tty->driver.subtype == PTY_TYPE_SLAVE && + if (tty->driver->type == TTY_DRIVER_TYPE_PTY && + tty->driver->subtype == PTY_TYPE_SLAVE && tty->link && tty->link->count) count++; if (tty->count != count) { @@ -319,8 +319,8 @@ static int tty_set_ldisc(struct tty_struct *tty, int ldisc) module_put(o_ldisc.owner); } - if (tty->ldisc.num != o_ldisc.num && tty->driver.set_ldisc) - tty->driver.set_ldisc(tty); + if (tty->ldisc.num != o_ldisc.num && tty->driver->set_ldisc) + tty->driver->set_ldisc(tty); return retval; } @@ -466,8 +466,8 @@ void do_tty_hangup(void *data) local_irq_save(flags); // FIXME: is this safe? if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) && tty->ldisc.write_wakeup) (tty->ldisc.write_wakeup)(tty); @@ -481,8 +481,8 @@ void do_tty_hangup(void *data) * Shutdown the current line discipline, and reset it to * N_TTY. */ - if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) - *tty->termios = tty->driver.init_termios; + if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) + *tty->termios = tty->driver->init_termios; if (tty->ldisc.num != ldiscs[N_TTY].num) { if (tty->ldisc.close) (tty->ldisc.close)(tty); @@ -525,11 +525,11 @@ void do_tty_hangup(void *data) * So we just call close() the right number of times. */ if (cons_filp) { - if (tty->driver.close) + if (tty->driver->close) for (n = 0; n < closecount; n++) - tty->driver.close(tty, cons_filp); - } else if (tty->driver.hangup) - (tty->driver.hangup)(tty); + tty->driver->close(tty, cons_filp); + } else if (tty->driver->hangup) + (tty->driver->hangup)(tty); unlock_kernel(); } @@ -589,7 +589,7 @@ void disassociate_ctty(int on_exit) tty = current->tty; if (tty) { tty_pgrp = tty->pgrp; - if (on_exit && tty->driver.type != TTY_DRIVER_TYPE_PTY) + if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY) tty_vhangup(tty); } else { if (current->tty_old_pgrp) { @@ -626,8 +626,8 @@ void stop_tty(struct tty_struct *tty) tty->ctrl_status |= TIOCPKT_STOP; wake_up_interruptible(&tty->link->read_wait); } - if (tty->driver.stop) - (tty->driver.stop)(tty); + if (tty->driver->stop) + (tty->driver->stop)(tty); } void start_tty(struct tty_struct *tty) @@ -640,8 +640,8 @@ void start_tty(struct tty_struct *tty) tty->ctrl_status |= TIOCPKT_START; wake_up_interruptible(&tty->link->read_wait); } - if (tty->driver.start) - (tty->driver.start)(tty); + if (tty->driver->start) + (tty->driver->start)(tty); if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) && tty->ldisc.write_wakeup) (tty->ldisc.write_wakeup)(tty); @@ -768,7 +768,7 @@ static ssize_t tty_write(struct file * file, const char * buf, size_t count, tty = (struct tty_struct *)file->private_data; if (tty_paranoia_check(tty, inode->i_rdev, "tty_write")) return -EIO; - if (!tty || !tty->driver.write || (test_bit(TTY_IO_ERROR, &tty->flags))) + if (!tty || !tty->driver->write || (test_bit(TTY_IO_ERROR, &tty->flags))) return -EIO; #if 0 if (!is_console && L_TOSTOP(tty) && (tty->pgrp > 0) && @@ -855,7 +855,7 @@ static int init_dev(kdev_t device, struct tty_struct **ret_tty) goto fail_no_mem; initialize_tty_struct(tty); tty->device = device; - tty->driver = *driver; + tty->driver = driver; tp_loc = &driver->termios[idx]; if (!*tp_loc) { @@ -882,7 +882,7 @@ static int init_dev(kdev_t device, struct tty_struct **ret_tty) initialize_tty_struct(o_tty); o_tty->device = mk_kdev(driver->other->major, driver->other->minor_start + idx); - o_tty->driver = *driver->other; + o_tty->driver = driver->other; o_tp_loc = &driver->other->termios[idx]; if (!*o_tp_loc) { @@ -981,7 +981,7 @@ fast_track: tty->link->count++; } tty->count++; - tty->driver = *driver; /* N.B. why do this every time?? */ + tty->driver = driver; /* N.B. why do this every time?? */ success: *ret_tty = tty; @@ -1026,32 +1026,32 @@ static void release_mem(struct tty_struct *tty, int idx) struct termios *tp; if ((o_tty = tty->link) != NULL) { - o_tty->driver.table[idx] = NULL; - if (o_tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) { - tp = o_tty->driver.termios[idx]; - o_tty->driver.termios[idx] = NULL; + o_tty->driver->table[idx] = NULL; + if (o_tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { + tp = o_tty->driver->termios[idx]; + o_tty->driver->termios[idx] = NULL; kfree(tp); } o_tty->magic = 0; - (*o_tty->driver.refcount)--; + (*o_tty->driver->refcount)--; file_list_lock(); list_del(&o_tty->tty_files); file_list_unlock(); free_tty_struct(o_tty); } - tty->driver.table[idx] = NULL; - if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) { - tp = tty->driver.termios[idx]; - tty->driver.termios[idx] = NULL; + tty->driver->table[idx] = NULL; + if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) { + tp = tty->driver->termios[idx]; + tty->driver->termios[idx] = NULL; kfree(tp); } tty->magic = 0; - (*tty->driver.refcount)--; + (*tty->driver->refcount)--; file_list_lock(); list_del(&tty->tty_files); file_list_unlock(); - module_put(tty->driver.owner); + module_put(tty->driver->owner); free_tty_struct(tty); } @@ -1078,29 +1078,29 @@ static void release_dev(struct file * filp) tty_fasync(-1, filp, 0); - idx = minor(tty->device) - tty->driver.minor_start; - pty_master = (tty->driver.type == TTY_DRIVER_TYPE_PTY && - tty->driver.subtype == PTY_TYPE_MASTER); + idx = minor(tty->device) - tty->driver->minor_start; + pty_master = (tty->driver->type == TTY_DRIVER_TYPE_PTY && + tty->driver->subtype == PTY_TYPE_MASTER); o_tty = tty->link; #ifdef TTY_PARANOIA_CHECK - if (idx < 0 || idx >= tty->driver.num) { + if (idx < 0 || idx >= tty->driver->num) { printk(KERN_DEBUG "release_dev: bad idx when trying to " "free (%s)\n", cdevname(tty->device)); return; } - if (tty != tty->driver.table[idx]) { + if (tty != tty->driver->table[idx]) { printk(KERN_DEBUG "release_dev: driver.table[%d] not tty " "for (%s)\n", idx, cdevname(tty->device)); return; } - if (tty->termios != tty->driver.termios[idx]) { + if (tty->termios != tty->driver->termios[idx]) { printk(KERN_DEBUG "release_dev: driver.termios[%d] not termios " "for (%s)\n", idx, cdevname(tty->device)); return; } - if (tty->termios_locked != tty->driver.termios_locked[idx]) { + if (tty->termios_locked != tty->driver->termios_locked[idx]) { printk(KERN_DEBUG "release_dev: driver.termios_locked[%d] not " "termios_locked for (%s)\n", idx, cdevname(tty->device)); @@ -1114,21 +1114,21 @@ static void release_dev(struct file * filp) #endif #ifdef TTY_PARANOIA_CHECK - if (tty->driver.other) { - if (o_tty != tty->driver.other->table[idx]) { + if (tty->driver->other) { + if (o_tty != tty->driver->other->table[idx]) { printk(KERN_DEBUG "release_dev: other->table[%d] " "not o_tty for (%s)\n", idx, cdevname(tty->device)); return; } - if (o_tty->termios != tty->driver.other->termios[idx]) { + if (o_tty->termios != tty->driver->other->termios[idx]) { printk(KERN_DEBUG "release_dev: other->termios[%d] " "not o_termios for (%s)\n", idx, cdevname(tty->device)); return; } if (o_tty->termios_locked != - tty->driver.other->termios_locked[idx]) { + tty->driver->other->termios_locked[idx]) { printk(KERN_DEBUG "release_dev: other->termios_locked[" "%d] not o_termios_locked for (%s)\n", idx, cdevname(tty->device)); @@ -1141,8 +1141,8 @@ static void release_dev(struct file * filp) } #endif - if (tty->driver.close) - tty->driver.close(tty, filp); + if (tty->driver->close) + tty->driver->close(tty, filp); /* * Sanity check: if tty->count is going to zero, there shouldn't be @@ -1390,14 +1390,14 @@ retry_open: filp->private_data = tty; file_move(filp, &tty->tty_files); check_tty_count(tty, "tty_open"); - if (tty->driver.type == TTY_DRIVER_TYPE_PTY && - tty->driver.subtype == PTY_TYPE_MASTER) + if (tty->driver->type == TTY_DRIVER_TYPE_PTY && + tty->driver->subtype == PTY_TYPE_MASTER) noctty = 1; #ifdef TTY_DEBUG_HANGUP printk(KERN_DEBUG "opening %s...", tty_name(tty, buf)); #endif - if (tty->driver.open) - retval = tty->driver.open(tty, filp); + if (tty->driver->open) + retval = tty->driver->open(tty, filp); else retval = -ENODEV; filp->f_flags = saved_flags; @@ -1434,8 +1434,8 @@ retry_open: tty->session = current->session; tty->pgrp = current->pgrp; } - if ((tty->driver.type == TTY_DRIVER_TYPE_SERIAL) && - (tty->driver.subtype == SERIAL_TYPE_CALLOUT) && + if ((tty->driver->type == TTY_DRIVER_TYPE_SERIAL) && + (tty->driver->subtype == SERIAL_TYPE_CALLOUT) && (tty->count == 1)) { static int nr_warns; if (nr_warns < 5) { @@ -1527,8 +1527,8 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty, if (!memcmp(&tmp_ws, &tty->winsize, sizeof(*arg))) return 0; #ifdef CONFIG_VT - if (tty->driver.type == TTY_DRIVER_TYPE_CONSOLE) { - unsigned int currcons = minor(tty->device) - tty->driver.minor_start; + if (tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) { + unsigned int currcons = minor(tty->device) - tty->driver->minor_start; if (vc_resize(currcons, tmp_ws.ws_col, tmp_ws.ws_row)) return -ENXIO; } @@ -1674,10 +1674,10 @@ static int send_break(struct tty_struct *tty, int duration) { set_current_state(TASK_INTERRUPTIBLE); - tty->driver.break_ctl(tty, -1); + tty->driver->break_ctl(tty, -1); if (!signal_pending(current)) schedule_timeout(duration); - tty->driver.break_ctl(tty, 0); + tty->driver->break_ctl(tty, 0); if (signal_pending(current)) return -EINTR; return 0; @@ -1688,8 +1688,8 @@ tty_tiocmget(struct tty_struct *tty, struct file *file, unsigned long arg) { int retval = -EINVAL; - if (tty->driver.tiocmget) { - retval = tty->driver.tiocmget(tty, file); + if (tty->driver->tiocmget) { + retval = tty->driver->tiocmget(tty, file); if (retval >= 0) retval = put_user(retval, (int *)arg); @@ -1703,7 +1703,7 @@ tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int cmd, { int retval = -EINVAL; - if (tty->driver.tiocmset) { + if (tty->driver->tiocmset) { unsigned int set, clear, val; retval = get_user(val, (unsigned int *)arg); @@ -1727,7 +1727,7 @@ tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int cmd, set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2; clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2; - retval = tty->driver.tiocmset(tty, file, set, clear); + retval = tty->driver->tiocmset(tty, file, set, clear); } return retval; } @@ -1746,28 +1746,28 @@ int tty_ioctl(struct inode * inode, struct file * file, return -EINVAL; real_tty = tty; - if (tty->driver.type == TTY_DRIVER_TYPE_PTY && - tty->driver.subtype == PTY_TYPE_MASTER) + if (tty->driver->type == TTY_DRIVER_TYPE_PTY && + tty->driver->subtype == PTY_TYPE_MASTER) real_tty = tty->link; /* * Break handling by driver */ - if (!tty->driver.break_ctl) { + if (!tty->driver->break_ctl) { switch(cmd) { case TIOCSBRK: case TIOCCBRK: - if (tty->driver.ioctl) - return tty->driver.ioctl(tty, file, cmd, arg); + if (tty->driver->ioctl) + return tty->driver->ioctl(tty, file, cmd, arg); return -EINVAL; /* These two ioctl's always return success; even if */ /* the driver doesn't support them. */ case TCSBRK: case TCSBRKP: - if (!tty->driver.ioctl) + if (!tty->driver->ioctl) return 0; - retval = tty->driver.ioctl(tty, file, cmd, arg); + retval = tty->driver->ioctl(tty, file, cmd, arg); if (retval == -ENOIOCTLCMD) retval = 0; return retval; @@ -1840,11 +1840,11 @@ int tty_ioctl(struct inode * inode, struct file * file, * Break handling */ case TIOCSBRK: /* Turn break on, unconditionally */ - tty->driver.break_ctl(tty, -1); + tty->driver->break_ctl(tty, -1); return 0; case TIOCCBRK: /* Turn break off, unconditionally */ - tty->driver.break_ctl(tty, 0); + tty->driver->break_ctl(tty, 0); return 0; case TCSBRK: /* SVID version: non-zero arg --> no break */ /* @@ -1866,8 +1866,8 @@ int tty_ioctl(struct inode * inode, struct file * file, case TIOCMBIS: return tty_tiocmset(tty, file, cmd, arg); } - if (tty->driver.ioctl) { - int retval = (tty->driver.ioctl)(tty, file, cmd, arg); + if (tty->driver->ioctl) { + int retval = (tty->driver->ioctl)(tty, file, cmd, arg); if (retval != -ENOIOCTLCMD) return retval; } @@ -1917,8 +1917,8 @@ static void __do_SAK(void *arg) session = tty->session; if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); read_lock(&tasklist_lock); for_each_task_pid(session, PIDTYPE_SID, p, l, pid) { if (p->tty == tty || session > 0) { @@ -2098,7 +2098,7 @@ static void initialize_tty_struct(struct tty_struct *tty) */ static void tty_default_put_char(struct tty_struct *tty, unsigned char ch) { - tty->driver.write(tty, 0, &ch, 1); + tty->driver->write(tty, 0, &ch, 1); } #ifdef CONFIG_DEVFS_FS diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index e89b692a2dedf..ad98940d49ece 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c @@ -45,7 +45,7 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout) printk(KERN_DEBUG "%s wait until sent...\n", tty_name(tty, buf)); #endif - if (!tty->driver.chars_in_buffer) + if (!tty->driver->chars_in_buffer) return; add_wait_queue(&tty->write_wait, &wait); if (!timeout) @@ -53,17 +53,17 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout) do { #ifdef TTY_DEBUG_WAIT_UNTIL_SENT printk(KERN_DEBUG "waiting %s...(%d)\n", tty_name(tty, buf), - tty->driver.chars_in_buffer(tty)); + tty->driver->chars_in_buffer(tty)); #endif set_current_state(TASK_INTERRUPTIBLE); if (signal_pending(current)) goto stop_waiting; - if (!tty->driver.chars_in_buffer(tty)) + if (!tty->driver->chars_in_buffer(tty)) break; timeout = schedule_timeout(timeout); } while (timeout); - if (tty->driver.wait_until_sent) - tty->driver.wait_until_sent(tty, timeout); + if (tty->driver->wait_until_sent) + tty->driver->wait_until_sent(tty, timeout); stop_waiting: set_current_state(TASK_RUNNING); remove_wait_queue(&tty->write_wait, &wait); @@ -131,8 +131,8 @@ static void change_termios(struct tty_struct * tty, struct termios * new_termios } } - if (tty->driver.set_termios) - (*tty->driver.set_termios)(tty, &old_termios); + if (tty->driver->set_termios) + (*tty->driver->set_termios)(tty, &old_termios); if (tty->ldisc.set_termios) (*tty->ldisc.set_termios)(tty, &old_termios); @@ -346,13 +346,13 @@ void send_prio_char(struct tty_struct *tty, char ch) { int was_stopped = tty->stopped; - if (tty->driver.send_xchar) { - tty->driver.send_xchar(tty, ch); + if (tty->driver->send_xchar) { + tty->driver->send_xchar(tty, ch); return; } if (was_stopped) start_tty(tty); - tty->driver.write(tty, 0, &ch, 1); + tty->driver->write(tty, 0, &ch, 1); if (was_stopped) stop_tty(tty); } @@ -363,8 +363,8 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, struct tty_struct * real_tty; int retval; - if (tty->driver.type == TTY_DRIVER_TYPE_PTY && - tty->driver.subtype == PTY_TYPE_MASTER) + if (tty->driver->type == TTY_DRIVER_TYPE_PTY && + tty->driver->subtype == PTY_TYPE_MASTER) real_tty = tty->link; else real_tty = tty; @@ -450,16 +450,16 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, tty->ldisc.flush_buffer(tty); /* fall through */ case TCOFLUSH: - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); break; default: return -EINVAL; } return 0; case TIOCOUTQ: - return put_user(tty->driver.chars_in_buffer ? - tty->driver.chars_in_buffer(tty) : 0, + return put_user(tty->driver->chars_in_buffer ? + tty->driver->chars_in_buffer(tty) : 0, (int *) arg); case TIOCINQ: retval = tty->read_cnt; @@ -482,8 +482,8 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, { int pktmode; - if (tty->driver.type != TTY_DRIVER_TYPE_PTY || - tty->driver.subtype != PTY_TYPE_MASTER) + if (tty->driver->type != TTY_DRIVER_TYPE_PTY || + tty->driver->subtype != PTY_TYPE_MASTER) return -ENOTTY; if (get_user(pktmode, (int *) arg)) return -EFAULT; diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c index 95cc54d04ed42..6ad591fe45b51 100644 --- a/drivers/char/vme_scc.c +++ b/drivers/char/vme_scc.c @@ -950,7 +950,7 @@ static int scc_open (struct tty_struct * tty, struct file * filp) } if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = port->gs.normal_termios; else *tty->termios = port->gs.callout_termios; diff --git a/drivers/char/vt.c b/drivers/char/vt.c index cb7f1ccd1b87e..6f2f354290988 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -2216,7 +2216,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) int lines; int ret; - if (tty->driver.type != TTY_DRIVER_TYPE_CONSOLE) + if (tty->driver->type != TTY_DRIVER_TYPE_CONSOLE) return -EINVAL; if (current->tty != tty && !capable(CAP_SYS_ADMIN)) return -EPERM; @@ -2345,7 +2345,7 @@ static void con_stop(struct tty_struct *tty) int console_num; if (!tty) return; - console_num = minor(tty->device) - (tty->driver.minor_start); + console_num = minor(tty->device) - (tty->driver->minor_start); if (!vc_cons_allocated(console_num)) return; set_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); @@ -2360,7 +2360,7 @@ static void con_start(struct tty_struct *tty) int console_num; if (!tty) return; - console_num = minor(tty->device) - (tty->driver.minor_start); + console_num = minor(tty->device) - (tty->driver->minor_start); if (!vc_cons_allocated(console_num)) return; clr_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); @@ -2392,7 +2392,7 @@ static int con_open(struct tty_struct *tty, struct file * filp) unsigned int currcons; int i; - currcons = minor(tty->device) - tty->driver.minor_start; + currcons = minor(tty->device) - tty->driver->minor_start; i = vc_allocate(currcons); if (i) @@ -2418,7 +2418,7 @@ static void con_close(struct tty_struct *tty, struct file * filp) if (!tty) return; if (tty->count != 1) return; - vcs_make_devfs (minor(tty->device) - tty->driver.minor_start, 1); + vcs_make_devfs (minor(tty->device) - tty->driver->minor_start, 1); vt = (struct vt_struct*)tty->driver_data; if (vt) vc_cons[vt->vc_num].d->vc_tty = NULL; diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c index 87c1eaa12b211..494e1f5c11eeb 100644 --- a/drivers/input/serio/serport.c +++ b/drivers/input/serio/serport.c @@ -44,7 +44,7 @@ char serport_name[] = "Serial port"; static int serport_serio_write(struct serio *serio, unsigned char data) { struct serport *serport = serio->driver; - return -(serport->tty->driver.write(serport->tty, 0, &data, 1) != 1); + return -(serport->tty->driver->write(serport->tty, 0, &data, 1) != 1); } static int serport_serio_open(struct serio *serio) diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 0053c471fb16a..6cc72a2762c76 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -1655,7 +1655,7 @@ isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info * * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == ISDN_SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == ISDN_SERIAL_TYPE_CALLOUT) { if (info->flags & ISDN_ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) && @@ -1766,14 +1766,14 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp) MOD_INC_USE_COUNT; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if (line < 0 || line > ISDN_MAX_CHANNELS) return -ENODEV; info = &isdn_mdm.info[line]; if (isdn_tty_paranoia_check(info, tty->device, "isdn_tty_open")) return -ENODEV; #ifdef ISDN_DEBUG_MODEM_OPEN - printk(KERN_DEBUG "isdn_tty_open %s%d, count = %d\n", tty->driver.name, + printk(KERN_DEBUG "isdn_tty_open %s%d, count = %d\n", tty->driver->name, info->line, info->count); #endif info->count++; @@ -1797,7 +1797,7 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp) return retval; } if ((info->count == 1) && (info->flags & ISDN_ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == ISDN_SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == ISDN_SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; @@ -1892,8 +1892,8 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp) } dev->modempoll--; isdn_tty_shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); info->tty = 0; diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c index 374d9ee892702..f447ac31d627e 100644 --- a/drivers/macintosh/macserial.c +++ b/drivers/macintosh/macserial.c @@ -2003,8 +2003,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) specific irqs */ spin_unlock_irqrestore(&info->lock, flags); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -2120,7 +2120,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ZILOG_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ZILOG_CALLOUT_ACTIVE) && @@ -2229,7 +2229,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) unsigned long page; MOD_INC_USE_COUNT; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= zs_channels_found)) { MOD_DEC_USE_COUNT; return -ENODEV; @@ -2244,7 +2244,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) #endif if (serial_paranoia_check(info, tty->device, "rs_open")) return -ENODEV; - OPNDBG("rs_open %s%d, count = %d, tty=%p\n", tty->driver.name, + OPNDBG("rs_open %s%d, count = %d, tty=%p\n", tty->driver->name, info->line, info->count, tty); info->count++; @@ -2292,7 +2292,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ZILOG_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 38b55e119c90c..61f2e29f066b5 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -315,13 +315,13 @@ static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) immediately after data has arrived. */ if (sp->duplex == 1) { sp->led_state = 0x70; - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); sp->tx_enable = 1; - actual = sp->tty->driver.write(sp->tty, 0, sp->xbuff, count); + actual = sp->tty->driver->write(sp->tty, 0, sp->xbuff, count); sp->xleft = count - actual; sp->xhead = sp->xbuff + actual; sp->led_state = 0x60; - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); } else { sp->xleft = count; sp->xhead = sp->xbuff; @@ -357,7 +357,7 @@ static void sixpack_write_wakeup(struct tty_struct *tty) } if (sp->tx_enable == 1) { - actual = tty->driver.write(tty, 0, sp->xhead, sp->xleft); + actual = tty->driver->write(tty, 0, sp->xhead, sp->xleft); sp->xleft -= actual; sp->xhead += actual; } @@ -394,13 +394,13 @@ static void sp_xmit_on_air(unsigned long channel) if (((sp->status1 & SIXP_DCD_MASK) == 0) && (random < sp->persistence)) { sp->led_state = 0x70; - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); sp->tx_enable = 1; - actual = sp->tty->driver.write(sp->tty, 0, sp->xbuff, sp->status2); + actual = sp->tty->driver->write(sp->tty, 0, sp->xbuff, sp->status2); sp->xleft -= actual; sp->xhead += actual; sp->led_state = 0x60; - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); sp->status2 = 0; } else sp_start_tx_timer(sp); @@ -566,8 +566,8 @@ static int sixpack_open(struct tty_struct *tty) return -ENFILE; sp->tty = tty; tty->disc_data = sp; - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -882,7 +882,7 @@ static int tnc_init(struct sixpack *sp) { unsigned char inbyte = 0xe8; - sp->tty->driver.write(sp->tty, 0, &inbyte, 1); + sp->tty->driver->write(sp->tty, 0, &inbyte, 1); del_timer(&sp->resync_t); sp->resync_t.data = (unsigned long) sp; @@ -924,9 +924,9 @@ static void decode_prio_command(unsigned char cmd, struct sixpack *sp) else { /* output watchdog char if idle */ if ((sp->status2 != 0) && (sp->duplex == 1)) { sp->led_state = 0x70; - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); sp->tx_enable = 1; - actual = sp->tty->driver.write(sp->tty, 0, sp->xbuff, sp->status2); + actual = sp->tty->driver->write(sp->tty, 0, sp->xbuff, sp->status2); sp->xleft -= actual; sp->xhead += actual; sp->led_state = 0x60; @@ -936,7 +936,7 @@ static void decode_prio_command(unsigned char cmd, struct sixpack *sp) } /* needed to trigger the TNC watchdog */ - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); /* if the state byte has been received, the TNC is present, so the resync timer can be reset. */ @@ -977,8 +977,8 @@ static void resync_tnc(unsigned long channel) /* resync the TNC */ sp->led_state = 0x60; - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); - sp->tty->driver.write(sp->tty, 0, &resync_cmd, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &resync_cmd, 1); /* Start resync timer again -- the TNC might be still absent */ @@ -1006,12 +1006,12 @@ static void decode_std_command(unsigned char cmd, struct sixpack *sp) if ((sp->status & SIXP_RX_DCD_MASK) == SIXP_RX_DCD_MASK) { sp->led_state = 0x68; - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); } } else { sp->led_state = 0x60; /* fill trailing bytes with zeroes */ - sp->tty->driver.write(sp->tty, 0, &sp->led_state, 1); + sp->tty->driver->write(sp->tty, 0, &sp->led_state, 1); rest = sp->rx_count; if (rest != 0) for (i = rest; i <= 3; i++) diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 68ef2d9bf9878..8670b1d487635 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c @@ -384,7 +384,7 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len) break; } ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = ax->tty->driver.write(ax->tty, 0, ax->xbuff, count); + actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count); ax->tx_packets++; ax->dev->trans_start = jiffies; ax->xleft = count - actual; @@ -392,7 +392,7 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len) } else { count = kiss_esc(p, (unsigned char *) ax->mkiss->xbuff, len); ax->mkiss->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = ax->mkiss->tty->driver.write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count); + actual = ax->mkiss->tty->driver->write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count); ax->tx_packets++; ax->mkiss->dev->trans_start = jiffies; ax->mkiss->xleft = count - actual; @@ -429,7 +429,7 @@ static void ax25_write_wakeup(struct tty_struct *tty) return; } - actual = tty->driver.write(tty, 0, ax->xhead, ax->xleft); + actual = tty->driver->write(tty, 0, ax->xhead, ax->xleft); ax->xleft -= actual; ax->xhead += actual; } @@ -475,7 +475,7 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev) } printk(KERN_ERR "mkiss: %s: transmit timed out, %s?\n", dev->name, - (ax->tty->driver.chars_in_buffer(ax->tty) || ax->xleft) ? + (ax->tty->driver->chars_in_buffer(ax->tty) || ax->xleft) ? "bad line quality" : "driver error"); ax->xleft = 0; @@ -643,8 +643,8 @@ static int ax25_open(struct tty_struct *tty) ax->mkiss = NULL; tmp_ax = NULL; - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index 90cb66d944c3e..6824a613a05c3 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c @@ -62,7 +62,7 @@ static int irtty_chars_in_buffer(struct sir_dev *dev) ASSERT(priv != NULL, return -1;); ASSERT(priv->magic == IRTTY_MAGIC, return -1;); - return priv->tty->driver.chars_in_buffer(priv->tty); + return priv->tty->driver->chars_in_buffer(priv->tty); } /* Wait (sleep) until underlaying hardware finished transmission @@ -91,9 +91,9 @@ static void irtty_wait_until_sent(struct sir_dev *dev) ASSERT(priv->magic == IRTTY_MAGIC, return;); tty = priv->tty; - if (tty->driver.wait_until_sent) { + if (tty->driver->wait_until_sent) { lock_kernel(); - tty->driver.wait_until_sent(tty, MSECS_TO_JIFFIES(100)); + tty->driver->wait_until_sent(tty, MSECS_TO_JIFFIES(100)); unlock_kernel(); } else { @@ -161,8 +161,8 @@ static int irtty_change_speed(struct sir_dev *dev, unsigned speed) } tty->termios->c_cflag = cflag; - if (tty->driver.set_termios) - tty->driver.set_termios(tty, &old_termios); + if (tty->driver->set_termios) + tty->driver->set_termios(tty, &old_termios); unlock_kernel(); priv->io.speed = speed; @@ -201,8 +201,8 @@ static int irtty_set_dtr_rts(struct sir_dev *dev, int dtr, int rts) * This function is not yet defined for all tty driver, so * let's be careful... Jean II */ - ASSERT(priv->tty->driver.tiocmset != NULL, return -1;); - priv->tty->driver.tiocmset(priv->tty, NULL, set, clear); + ASSERT(priv->tty->driver->tiocmset != NULL, return -1;); + priv->tty->driver->tiocmset(priv->tty, NULL, set, clear); return 0; } @@ -231,17 +231,17 @@ static int irtty_do_write(struct sir_dev *dev, const unsigned char *ptr, size_t ASSERT(priv->magic == IRTTY_MAGIC, return -1;); tty = priv->tty; - if (!tty->driver.write) + if (!tty->driver->write) return 0; tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - if (tty->driver.write_room) { - writelen = tty->driver.write_room(tty); + if (tty->driver->write_room) { + writelen = tty->driver->write_room(tty); if (writelen > len) writelen = len; } else writelen = len; - return tty->driver.write(tty, 0, ptr, writelen); + return tty->driver->write(tty, 0, ptr, writelen); } /* ------------------------------------------------------- */ @@ -354,8 +354,8 @@ static inline void irtty_stop_receiver(struct tty_struct *tty, int stop) cflag |= CREAD; tty->termios->c_cflag = cflag; - if (tty->driver.set_termios) - tty->driver.set_termios(tty, &old_termios); + if (tty->driver->set_termios) + tty->driver->set_termios(tty, &old_termios); unlock_kernel(); } @@ -381,8 +381,8 @@ static int irtty_start_dev(struct sir_dev *dev) tty = priv->tty; - if (tty->driver.start) - tty->driver.start(tty); + if (tty->driver->start) + tty->driver->start(tty); /* Make sure we can receive more data */ irtty_stop_receiver(tty, FALSE); @@ -410,8 +410,8 @@ static int irtty_stop_dev(struct sir_dev *dev) /* Make sure we don't receive more data */ irtty_stop_receiver(tty, TRUE); - if (tty->driver.stop) - tty->driver.stop(tty); + if (tty->driver->stop) + tty->driver->stop(tty); up(&irtty_sem); @@ -522,11 +522,11 @@ static int irtty_open(struct tty_struct *tty) /* stop the underlying driver */ irtty_stop_receiver(tty, TRUE); - if (tty->driver.stop) - tty->driver.stop(tty); + if (tty->driver->stop) + tty->driver->stop(tty); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); /* from old irtty - but what is it good for? * we _are_ the ldisc and we _don't_ implement flush_buffer! @@ -538,15 +538,15 @@ static int irtty_open(struct tty_struct *tty) /* create device name - could we use tty_name() here? */ - if (strchr(tty->driver.name, '%')) { - sprintf(hwname, tty->driver.name, - minor(tty->device) - tty->driver.minor_start + - tty->driver.name_base); + if (strchr(tty->driver->name, '%')) { + sprintf(hwname, tty->driver->name, + minor(tty->device) - tty->driver->minor_start + + tty->driver->name_base); } else { - sprintf(hwname, "%s%d", tty->driver.name, - minor(tty->device) - tty->driver.minor_start + - tty->driver.name_base); + sprintf(hwname, "%s%d", tty->driver->name, + minor(tty->device) - tty->driver->minor_start + + tty->driver->name_base); } /* apply mtt override */ @@ -625,8 +625,8 @@ static void irtty_close(struct tty_struct *tty) /* Stop tty */ irtty_stop_receiver(tty, TRUE); tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); - if (tty->driver.stop) - tty->driver.stop(tty); + if (tty->driver->stop) + tty->driver->stop(tty); kfree(priv); diff --git a/drivers/net/irda/irtty.c b/drivers/net/irda/irtty.c index 75f2d5fe9d30d..4c6d89c222bad 100644 --- a/drivers/net/irda/irtty.c +++ b/drivers/net/irda/irtty.c @@ -170,14 +170,14 @@ static int irtty_open(struct tty_struct *tty) tty->disc_data = self; /* Give self a name */ - sprintf(name, "%s%d", tty->driver.name, - minor(tty->device) - tty->driver.minor_start + - tty->driver.name_base); + sprintf(name, "%s%d", tty->driver->name, + minor(tty->device) - tty->driver->minor_start + + tty->driver->name_base); hashbin_insert(irtty, (irda_queue_t *) self, (int) self, NULL); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -335,7 +335,7 @@ static void irtty_stop_receiver(struct irtty_cb *self, int stop) /* This is unsafe, but currently under discussion - Jean II */ self->tty->termios->c_cflag = cflag; - self->tty->driver.set_termios(self->tty, &old_termios); + self->tty->driver->set_termios(self->tty, &old_termios); } /* @@ -388,7 +388,7 @@ static void __irtty_change_speed(struct irtty_cb *self, __u32 speed) /* This is unsafe, but currently under discussion - Jean II */ self->tty->termios->c_cflag = cflag; - self->tty->driver.set_termios(self->tty, &old_termios); + self->tty->driver->set_termios(self->tty, &old_termios); self->io.speed = speed; } @@ -429,7 +429,7 @@ static int irtty_change_speed(struct irda_task *task) * Make sure all data is sent before changing the speed of the * serial port. */ - if (self->tty->driver.chars_in_buffer(self->tty)) { + if (self->tty->driver->chars_in_buffer(self->tty)) { /* Keep state, and try again later */ ret = MSECS_TO_JIFFIES(10); break; @@ -684,8 +684,8 @@ static int irtty_hard_xmit(struct sk_buff *skb, struct net_device *dev) dev->trans_start = jiffies; self->stats.tx_bytes += self->tx_buff.len; - if (self->tty->driver.write) - actual = self->tty->driver.write(self->tty, 0, + if (self->tty->driver->write) + actual = self->tty->driver->write(self->tty, 0, self->tx_buff.data, self->tx_buff.len); /* Hide the part we just transmitted */ @@ -738,7 +738,7 @@ static void irtty_write_wakeup(struct tty_struct *tty) /* Finished with frame? */ if (self->tx_buff.len > 0) { /* Write data left in transmit buffer */ - actual = tty->driver.write(tty, 0, self->tx_buff.data, + actual = tty->driver->write(tty, 0, self->tx_buff.data, self->tx_buff.len); self->tx_buff.data += actual; @@ -823,7 +823,7 @@ static int irtty_set_dtr_rts(struct net_device *dev, int dtr, int rts) set_fs(get_ds()); /* This is probably unsafe, but currently under discussion - Jean II */ - if (tty->driver.ioctl(tty, NULL, TIOCMSET, (unsigned long) &arg)) { + if (tty->driver->ioctl(tty, NULL, TIOCMSET, (unsigned long) &arg)) { IRDA_DEBUG(2, "%s(), error doing ioctl!\n", __FUNCTION__); } set_fs(fs); @@ -923,8 +923,8 @@ static int irtty_raw_write(struct net_device *dev, __u8 *buf, int len) ASSERT(self != NULL, return 0;); ASSERT(self->magic == IRTTY_MAGIC, return 0;); - if (self->tty->driver.write) - actual = self->tty->driver.write(self->tty, 0, buf, len); + if (self->tty->driver->write) + actual = self->tty->driver->write(self->tty, 0, buf, len); return actual; } @@ -957,9 +957,9 @@ static int irtty_net_open(struct net_device *dev) irtty_stop_receiver(self, FALSE); /* Give self a hardware name */ - sprintf(hwname, "%s%d", tty->driver.name, - minor(tty->device) - tty->driver.minor_start + - tty->driver.name_base); + sprintf(hwname, "%s%d", tty->driver->name, + minor(tty->device) - tty->driver->minor_start + + tty->driver->name_base); /* * Open new IrLAP layer instance, now that everything should be diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 293c6a11e3747..13185a72a2d25 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c @@ -332,8 +332,8 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, spin_unlock_bh(&ap->recv_lock); ap_put(ap); if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) - && tty->driver.unthrottle) - tty->driver.unthrottle(tty); + && tty->driver->unthrottle) + tty->driver->unthrottle(tty); } static void @@ -662,7 +662,7 @@ ppp_async_push(struct asyncppp *ap) if (!tty_stuffed && ap->optr < ap->olim) { avail = ap->olim - ap->optr; set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - sent = tty->driver.write(tty, 0, ap->optr, avail); + sent = tty->driver->write(tty, 0, ap->optr, avail); if (sent < 0) goto flush; /* error, e.g. loss of CD */ ap->optr += sent; diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index a6f8788b7d1fa..c4c6e0d13d417 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c @@ -385,8 +385,8 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf, spin_unlock_bh(&ap->recv_lock); sp_put(ap); if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) - && tty->driver.unthrottle) - tty->driver.unthrottle(tty); + && tty->driver->unthrottle) + tty->driver->unthrottle(tty); } static void @@ -610,7 +610,7 @@ ppp_sync_push(struct syncppp *ap) tty_stuffed = 0; if (!tty_stuffed && ap->tpkt != 0) { set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - sent = tty->driver.write(tty, 0, ap->tpkt->data, ap->tpkt->len); + sent = tty->driver->write(tty, 0, ap->tpkt->data, ap->tpkt->len); if (sent < 0) goto flush; /* error, e.g. loss of CD */ if (sent < ap->tpkt->len) { diff --git a/drivers/net/slip.c b/drivers/net/slip.c index f146ae868c22c..5a437dca6e775 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -428,7 +428,7 @@ sl_encaps(struct slip *sl, unsigned char *icp, int len) * 14 Oct 1994 Dmitry Gorodchanin. */ sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = sl->tty->driver.write(sl->tty, 0, sl->xbuff, count); + actual = sl->tty->driver->write(sl->tty, 0, sl->xbuff, count); #ifdef SL_CHECK_TRANSMIT sl->dev->trans_start = jiffies; #endif @@ -462,7 +462,7 @@ static void slip_write_wakeup(struct tty_struct *tty) return; } - actual = tty->driver.write(tty, 0, sl->xhead, sl->xleft); + actual = tty->driver->write(tty, 0, sl->xhead, sl->xleft); sl->xleft -= actual; sl->xhead += actual; } @@ -488,7 +488,7 @@ static void sl_tx_timeout(struct net_device *dev) goto out; } printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, - (sl->tty->driver.chars_in_buffer(sl->tty) || sl->xleft) ? + (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) ? "bad line quality" : "driver error"); sl->xleft = 0; sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); @@ -861,8 +861,8 @@ slip_open(struct tty_struct *tty) tty->disc_data = sl; sl->line = tty->device; sl->pid = current->pid; - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); @@ -1456,7 +1456,7 @@ static void sl_outfill(unsigned long sls) if (!netif_queue_stopped(sl->dev)) { /* if device busy no outfill */ - sl->tty->driver.write(sl->tty, 0, &s, 1); + sl->tty->driver->write(sl->tty, 0, &s, 1); } } else diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index 69565d05d847c..e07301da8e972 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c @@ -318,7 +318,7 @@ static int cpc_tty_open(struct tty_struct *tty, struct file *flip) return -ENODEV; } - port = minor(tty->device) - tty->driver.minor_start; + port = minor(tty->device) - tty->driver->minor_start; if ((port < 0) || (port >= CPC_TTY_NPORTS)){ CPC_TTY_DBG("pc300_tty: open invalid minor %i\n",MINOR(tty->device)); diff --git a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c index 897f4573a5107..4983a7e2b7418 100644 --- a/drivers/net/wan/sdla_chdlc.c +++ b/drivers/net/wan/sdla_chdlc.c @@ -3698,7 +3698,7 @@ static int wanpipe_tty_open(struct tty_struct *tty, struct file * filp) if (!tty->driver_data){ int port; - port = minor(tty->device) - tty->driver.minor_start; + port = minor(tty->device) - tty->driver->minor_start; if ((port < 0) || (port >= NR_PORTS)) return -ENODEV; diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 434c17cf6a64f..5d38b7b9a9145 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c @@ -288,7 +288,7 @@ static void x25_asy_encaps(struct x25_asy *sl, unsigned char *icp, int len) * 14 Oct 1994 Dmitry Gorodchanin. */ sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); - actual = sl->tty->driver.write(sl->tty, 0, sl->xbuff, count); + actual = sl->tty->driver->write(sl->tty, 0, sl->xbuff, count); sl->xleft = count - actual; sl->xhead = sl->xbuff + actual; /* VSV */ @@ -318,7 +318,7 @@ static void x25_asy_write_wakeup(struct tty_struct *tty) return; } - actual = tty->driver.write(tty, 0, sl->xhead, sl->xleft); + actual = tty->driver->write(tty, 0, sl->xhead, sl->xleft); sl->xleft -= actual; sl->xhead += actual; } @@ -330,7 +330,7 @@ static void x25_asy_timeout(struct net_device *dev) * 14 Oct 1994 Dmitry Gorodchanin. */ printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, - (sl->tty->driver.chars_in_buffer(sl->tty) || sl->xleft) ? + (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) ? "bad line quality" : "driver error"); sl->xleft = 0; sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); @@ -620,8 +620,8 @@ static int x25_asy_open_tty(struct tty_struct *tty) sl->tty = tty; tty->disc_data = sl; - if (tty->driver.flush_buffer) { - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) { + tty->driver->flush_buffer(tty); } if (tty->ldisc.flush_buffer) { tty->ldisc.flush_buffer(tty); diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index b2cf1ad6a5134..aee42c4994d37 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c @@ -801,7 +801,7 @@ static void set_baud(struct tty_struct *tty, unsigned int baudcode) struct termios old_termios = *(tty->termios); tty->termios->c_cflag &= ~CBAUD; /* Clear the old baud setting */ tty->termios->c_cflag |= baudcode; /* Set the new baud setting */ - tty->driver.set_termios(tty, &old_termios); + tty->driver->set_termios(tty, &old_termios); } /* @@ -1266,7 +1266,7 @@ static void ResetRadio(struct strip *strip_info) set_baud(tty, strip_info->user_baud); } - tty->driver.write(tty, 0, s.string, s.length); + tty->driver->write(tty, 0, s.string, s.length); #ifdef EXT_COUNTERS strip_info->tx_ebytes += s.length; #endif @@ -1288,7 +1288,7 @@ static void strip_write_some_more(struct tty_struct *tty) if (strip_info->tx_left > 0) { int num_written = - tty->driver.write(tty, 0, strip_info->tx_head, + tty->driver->write(tty, 0, strip_info->tx_head, strip_info->tx_left); strip_info->tx_left -= num_written; strip_info->tx_head += num_written; @@ -2688,8 +2688,8 @@ static int strip_open(struct tty_struct *tty) strip_info->tty = tty; tty->disc_data = strip_info; - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 31a5102e84fcf..139f07da966ca 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -957,7 +957,7 @@ tty3215_open(struct tty_struct *tty, struct file * filp) struct raw3215_info *raw; int retval, line; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_3215)) return -ENODEV; diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c index 2861ae8de5091..c55ee5796c9b7 100644 --- a/drivers/s390/net/ctctty.c +++ b/drivers/s390/net/ctctty.c @@ -973,7 +973,7 @@ ctc_tty_open(struct tty_struct *tty, struct file *filp) int retval, line; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if (line < 0 || line > CTC_TTY_MAX_DEVICES) return -ENODEV; info = &driver->info[line]; @@ -982,7 +982,7 @@ ctc_tty_open(struct tty_struct *tty, struct file *filp) if (!info->netdev) return -ENODEV; #ifdef CTC_DEBUG_MODEM_OPEN - printk(KERN_DEBUG "ctc_tty_open %s%d, count = %d\n", tty->driver.name, + printk(KERN_DEBUG "ctc_tty_open %s%d, count = %d\n", tty->driver->name, info->line, info->count); #endif spin_lock_irqsave(&ctc_tty_lock, saveflags); @@ -1091,8 +1091,8 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp) } } ctc_tty_shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); info->tty = 0; diff --git a/drivers/sbus/char/aurora.c b/drivers/sbus/char/aurora.c index 7bc1f9cb66484..f57a82d23cf83 100644 --- a/drivers/sbus/char/aurora.c +++ b/drivers/sbus/char/aurora.c @@ -1564,8 +1564,8 @@ static void aurora_close(struct tty_struct * tty, struct file * filp) printk("aurora_close: shutdown_port\n"); #endif aurora_shutdown_port(bp, port); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c index 38d65f5769347..b7ad9f03a4ff4 100644 --- a/drivers/serial/68328serial.c +++ b/drivers/serial/68328serial.c @@ -1198,8 +1198,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) uart->ustcnt &= ~(USTCNT_RXEN | USTCNT_RX_INTR_MASK); shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1277,7 +1277,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & S_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & S_CALLOUT_ACTIVE) && @@ -1374,7 +1374,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) struct m68k_serial *info; int retval, line; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if (line >= NR_PORTS || line < 0) /* we have exactly one */ return -ENODEV; @@ -1401,7 +1401,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & S_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index 27f1539c12b4b..a40c6553be475 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -1754,8 +1754,8 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) rs_360_wait_until_sent(tty, info->timeout); } shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1905,7 +1905,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -2041,7 +2041,7 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp) ser_info_t *info; int retval, line; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) return -ENODEV; retval = get_async_struct(line, &info); @@ -2051,7 +2051,7 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp) return -ENODEV; #ifdef SERIAL_DEBUG_OPEN - printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line, info->state->count); #endif tty->driver_data = info; @@ -2077,7 +2077,7 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp) if ((info->state->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->state->normal_termios; else *tty->termios = info->state->callout_termios; diff --git a/drivers/serial/core.c b/drivers/serial/core.c index 204a52e4edc87..c242f8f6e8bd7 100644 --- a/drivers/serial/core.c +++ b/drivers/serial/core.c @@ -578,7 +578,7 @@ static void uart_flush_buffer(struct tty_struct *tty) unsigned long flags; DPRINTK("uart_flush_buffer(%d) called\n", - minor(tty->device) - tty->driver.minor_start); + minor(tty->device) - tty->driver->minor_start); spin_lock_irqsave(&port->lock, flags); uart_circ_clear(&state->info->xmit); @@ -839,7 +839,7 @@ uart_set_info(struct uart_state *state, struct serial_struct *newinfo) * need to rate-limit; it's CAP_SYS_ADMIN only. */ if (port->flags & UPF_SPD_MASK) { printk(KERN_NOTICE "%s sets custom speed on %s%d. This is deprecated.\n", - current->comm, state->info->tty->driver.name, + current->comm, state->info->tty->driver->name, state->port->line); } uart_change_speed(state, NULL); @@ -1234,7 +1234,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp) } if (--state->count < 0) { printk("rs_close: bad serial port count for %s%d: %d\n", - tty->driver.name, port->line, state->count); + tty->driver->name, port->line, state->count); state->count = 0; } if (state->count) @@ -1554,20 +1554,20 @@ static struct uart_state *uart_get(struct uart_driver *drv, int line) */ static int uart_open(struct tty_struct *tty, struct file *filp) { - struct uart_driver *drv = (struct uart_driver *)tty->driver.driver_state; + struct uart_driver *drv = (struct uart_driver *)tty->driver->driver_state; struct uart_state *state; - int retval, line = minor(tty->device) - tty->driver.minor_start; + int retval, line = minor(tty->device) - tty->driver->minor_start; BUG_ON(!kernel_locked()); DPRINTK("uart_open(%d) called\n", line); /* - * tty->driver.num won't change, so we won't fail here with + * tty->driver->num won't change, so we won't fail here with * tty->driver_data set to something non-NULL (and therefore * we won't get caught by uart_close()). */ retval = -ENODEV; - if (line >= tty->driver.num) + if (line >= tty->driver->num) goto fail; /* diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c index 5ec60685b87c2..b89dfd95d1fab 100644 --- a/drivers/serial/mcfserial.c +++ b/drivers/serial/mcfserial.c @@ -1229,8 +1229,8 @@ static void mcfrs_close(struct tty_struct *tty, struct file * filp) } else #endif shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1308,7 +1308,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ASYNC_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ASYNC_CALLOUT_ACTIVE) && @@ -1416,14 +1416,14 @@ int mcfrs_open(struct tty_struct *tty, struct file * filp) struct mcf_serial *info; int retval, line; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= NR_PORTS)) return -ENODEV; info = mcfrs_table + line; if (serial_paranoia_check(info, tty->device, "mcfrs_open")) return -ENODEV; #ifdef SERIAL_DEBUG_OPEN - printk("mcfrs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("mcfrs_open %s%d, count = %d\n", tty->driver->name, info->line, info->count); #endif info->count++; @@ -1447,7 +1447,7 @@ int mcfrs_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/sgi/char/sgiserial.c b/drivers/sgi/char/sgiserial.c index 9fed6cfbd9afd..54b8c88a1ab79 100644 --- a/drivers/sgi/char/sgiserial.c +++ b/drivers/sgi/char/sgiserial.c @@ -1539,8 +1539,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) ZS_CLEARFIFO(info->zs_channel); shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1618,7 +1618,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ZILOG_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ZILOG_CALLOUT_ACTIVE) && @@ -1725,7 +1725,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) struct sgi_serial *info; int retval, line; - line = MINOR(tty->device) - tty->driver.minor_start; + line = MINOR(tty->device) - tty->driver->minor_start; /* The zilog lines for the mouse/keyboard must be * opened using their respective drivers. */ @@ -1738,7 +1738,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) if (serial_paranoia_check(info, tty->device, "rs_open")) return -ENODEV; #ifdef SERIAL_DEBUG_OPEN - printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line, info->count); #endif info->count++; @@ -1762,7 +1762,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ZILOG_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c index 6ffa6a963d3ad..a24d5c4eea4c5 100644 --- a/drivers/tc/zs.c +++ b/drivers/tc/zs.c @@ -1424,8 +1424,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp) } shutdown(info); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); tty->closing = 0; @@ -1527,7 +1527,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, * If this is a callout device, then just make sure the normal * device isn't being used. */ - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { if (info->flags & ZILOG_NORMAL_ACTIVE) return -EBUSY; if ((info->flags & ZILOG_CALLOUT_ACTIVE) && @@ -1639,7 +1639,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) struct dec_serial *info; int retval, line; - line = MINOR(tty->device) - tty->driver.minor_start; + line = MINOR(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= zs_channels_found)) return -ENODEV; info = zs_soft + line; @@ -1650,7 +1650,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) if (serial_paranoia_check(info, tty->device, "rs_open")) return -ENODEV; #ifdef SERIAL_DEBUG_OPEN - printk("rs_open %s%d, count = %d\n", tty->driver.name, info->line, + printk("rs_open %s%d, count = %d\n", tty->driver->name, info->line, info->count); #endif @@ -1690,7 +1690,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) } if ((info->count == 1) && (info->flags & ZILOG_SPLIT_TERMIOS)) { - if (tty->driver.subtype == SERIAL_TYPE_NORMAL) + if (tty->driver->subtype == SERIAL_TYPE_NORMAL) *tty->termios = info->normal_termios; else *tty->termios = info->callout_termios; diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 8d5db2732654d..97a2c2eaf2f0f 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -1565,8 +1565,8 @@ dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_co } /* flush driver and line discipline buffers */ - if( tty->driver.flush_buffer ) - tty->driver.flush_buffer( tty ); + if( tty->driver->flush_buffer ) + tty->driver->flush_buffer( tty ); if( tty->ldisc.flush_buffer ) tty->ldisc.flush_buffer( tty ); diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 7acdf0580a3f9..d71084d0b0501 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -646,8 +646,8 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp) } */ - if (port->tty->driver.flush_buffer) - port->tty->driver.flush_buffer(port->tty); + if (port->tty->driver->flush_buffer) + port->tty->driver->flush_buffer(port->tty); if (port->tty->ldisc.flush_buffer) port->tty->ldisc.flush_buffer(port->tty); diff --git a/include/linux/tty.h b/include/linux/tty.h index 9c16b6c58bd0b..1ee727bd536cb 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -259,7 +259,7 @@ struct tty_flip_buffer { */ struct tty_struct { int magic; - struct tty_driver driver; + struct tty_driver *driver; struct tty_ldisc ldisc; struct termios *termios, *termios_locked; int pgrp; diff --git a/kernel/printk.c b/kernel/printk.c index 4872b44905610..a7a9811929b95 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -674,7 +674,7 @@ EXPORT_SYMBOL(unregister_console); */ void tty_write_message(struct tty_struct *tty, char *msg) { - if (tty && tty->driver.write) - tty->driver.write(tty, 0, msg, strlen(msg)); + if (tty && tty->driver->write) + tty->driver->write(tty, 0, msg, strlen(msg)); return; } diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index bb1db209e5ea1..71d8cd3521962 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c @@ -532,7 +532,7 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp) struct rfcomm_dlc *dlc; int err, id; - id = minor(tty->device) - tty->driver.minor_start; + id = minor(tty->device) - tty->driver->minor_start; BT_DBG("tty %p id %d", tty, id); diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 8729898f7a767..414bbe9b76cdb 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -48,8 +48,8 @@ static void print_string(char *str) /* The tty for the current task */ my_tty = current->tty; if (my_tty != NULL) { - (*(my_tty->driver).write)(my_tty, 0, str, strlen(str)); - (*(my_tty->driver).write)(my_tty, 0, "\015\012", 2); + my_tty->driver->write(my_tty, 0, str, strlen(str)); + my_tty->driver->write(my_tty, 0, "\015\012", 2); } } diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 20e0669591aec..17addb35043f2 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c @@ -251,7 +251,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, tty = self->tty; - if (tty->driver.subtype == SERIAL_TYPE_CALLOUT) { + if (tty->driver->subtype == SERIAL_TYPE_CALLOUT) { /* this is a callout device */ /* just verify that normal device is not in use */ if (self->flags & ASYNC_NORMAL_ACTIVE) @@ -306,7 +306,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, add_wait_queue(&self->open_wait, &wait); IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n", - __FILE__,__LINE__, tty->driver.name, self->open_count ); + __FILE__,__LINE__, tty->driver->name, self->open_count ); /* As far as I can see, we protect open_count - Jean II */ spin_lock_irqsave(&self->spinlock, flags); @@ -356,7 +356,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, } IRDA_DEBUG(1, "%s(%d):block_til_ready blocking on %s open_count=%d\n", - __FILE__,__LINE__, tty->driver.name, self->open_count ); + __FILE__,__LINE__, tty->driver->name, self->open_count ); schedule(); } @@ -373,7 +373,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, self->blocked_open--; IRDA_DEBUG(1, "%s(%d):block_til_ready after blocking on %s open_count=%d\n", - __FILE__,__LINE__, tty->driver.name, self->open_count); + __FILE__,__LINE__, tty->driver->name, self->open_count); if (!retval) self->flags |= ASYNC_NORMAL_ACTIVE; @@ -398,7 +398,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); MOD_INC_USE_COUNT; - line = minor(tty->device) - tty->driver.minor_start; + line = minor(tty->device) - tty->driver->minor_start; if ((line < 0) || (line >= IRCOMM_TTY_PORTS)) { MOD_DEC_USE_COUNT; return -ENODEV; @@ -451,7 +451,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) self->tty = tty; spin_unlock_irqrestore(&self->spinlock, flags); - IRDA_DEBUG(1, "%s(), %s%d, count = %d\n", __FUNCTION__ , tty->driver.name, + IRDA_DEBUG(1, "%s(), %s%d, count = %d\n", __FUNCTION__ , tty->driver->name, self->line, self->open_count); /* Not really used by us, but lets do it anyway */ @@ -592,8 +592,8 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) ircomm_tty_shutdown(self); - if (tty->driver.flush_buffer) - tty->driver.flush_buffer(tty); + if (tty->driver->flush_buffer) + tty->driver->flush_buffer(tty); if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty); -- 2.53.0