aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mxser_new.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2006-12-08 05:38:24 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:54 -0500
commit7e8bcf9add02176be7e052b1f0675f7a462eaf3d (patch)
treedc19caf11a531ef02d2aec8f92cb94dabe565ce7 /drivers/char/mxser_new.c
parent6faa3778ff69309bd3673412f0eb1e7ffee9ff83 (diff)
[PATCH] Char: mxser_new, eliminate tty ldisc deref
Use tty_ldisc_flush and tty_wakeup helpers for accessing ldisc internals. Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/mxser_new.c')
-rw-r--r--drivers/char/mxser_new.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 8a26ce125975..71381f955567 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -1065,7 +1065,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
1065 1065
1066 unsigned long timeout; 1066 unsigned long timeout;
1067 unsigned long flags; 1067 unsigned long flags;
1068 struct tty_ldisc *ld;
1069 1068
1070 if (tty->index == MXSER_PORTS) 1069 if (tty->index == MXSER_PORTS)
1071 return; 1070 return;
@@ -1145,12 +1144,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
1145 if (tty->driver->flush_buffer) 1144 if (tty->driver->flush_buffer)
1146 tty->driver->flush_buffer(tty); 1145 tty->driver->flush_buffer(tty);
1147 1146
1148 ld = tty_ldisc_ref(tty); 1147 tty_ldisc_flush(tty);
1149 if (ld) {
1150 if (ld->flush_buffer)
1151 ld->flush_buffer(tty);
1152 tty_ldisc_deref(ld);
1153 }
1154 1148
1155 tty->closing = 0; 1149 tty->closing = 0;
1156 info->event = 0; 1150 info->event = 0;
@@ -1303,9 +1297,7 @@ static void mxser_flush_buffer(struct tty_struct *tty)
1303 spin_unlock_irqrestore(&info->slock, flags); 1297 spin_unlock_irqrestore(&info->slock, flags);
1304 /* above added by shinhay */ 1298 /* above added by shinhay */
1305 1299
1306 wake_up_interruptible(&tty->write_wait); 1300 tty_wakeup(tty);
1307 if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
1308 (tty->ldisc.write_wakeup) (tty);
1309} 1301}
1310 1302
1311/* 1303/*