提交 7e8bcf9a 编写于 作者: J Jiri Slaby 提交者: Linus Torvalds

[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: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6faa3778
...@@ -1065,7 +1065,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) ...@@ -1065,7 +1065,6 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
unsigned long timeout; unsigned long timeout;
unsigned long flags; unsigned long flags;
struct tty_ldisc *ld;
if (tty->index == MXSER_PORTS) if (tty->index == MXSER_PORTS)
return; return;
...@@ -1145,12 +1144,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) ...@@ -1145,12 +1144,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
if (tty->driver->flush_buffer) if (tty->driver->flush_buffer)
tty->driver->flush_buffer(tty); tty->driver->flush_buffer(tty);
ld = tty_ldisc_ref(tty); tty_ldisc_flush(tty);
if (ld) {
if (ld->flush_buffer)
ld->flush_buffer(tty);
tty_ldisc_deref(ld);
}
tty->closing = 0; tty->closing = 0;
info->event = 0; info->event = 0;
...@@ -1303,9 +1297,7 @@ static void mxser_flush_buffer(struct tty_struct *tty) ...@@ -1303,9 +1297,7 @@ static void mxser_flush_buffer(struct tty_struct *tty)
spin_unlock_irqrestore(&info->slock, flags); spin_unlock_irqrestore(&info->slock, flags);
/* above added by shinhay */ /* above added by shinhay */
wake_up_interruptible(&tty->write_wait); tty_wakeup(tty);
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup) (tty);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册