Skip to contentSkip to conversation

Char: mxser_new, eliminate tty ldisc deref

PATCH New Jiri Slaby 1 participant 1 message Oct 6, 2006

Subsystems (2)
lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/6 Char: mxser_new, eliminate tty ldisc deref

mxser_new, eliminate tty ldisc deref

Use tty_ldisc_flush and tty_wakeup helpers for accessing ldisc internals.

---
commit f1ec019ded64c90bc2c8017a41bd77c8f900711c
tree 2c0916affadc7d056cd8ce397109a3f85bfc4c1f
parent b886c49c87ee91a038b917f6933183db8ae58125
author Jiri Slaby <[email protected]> Fri, 06 Oct 2006 23:14:52 +0200 committer Jiri Slaby <[email protected]> Fri, 06 Oct 2006 23:14:52 +0200

 drivers/char/mxser_new.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
drivers/char/mxser_new.c +2 -10
index a555dda..1f53e07 100644
@@ -1065,7 +1065,6 @@ static void mxser_close(struct tty_struc
 
 	unsigned long timeout;
 	unsigned long flags;
-	struct tty_ldisc *ld;
 
 	if (tty->index == MXSER_PORTS)
 		return;
@@ -1145,12 +1144,7 @@ static void mxser_close(struct tty_struc
 	if (tty->driver->flush_buffer)
 		tty->driver->flush_buffer(tty);
 
-	ld = tty_ldisc_ref(tty);
-	if (ld) {
-		if (ld->flush_buffer)
-			ld->flush_buffer(tty);
-		tty_ldisc_deref(ld);
-	}
+	tty_ldisc_flush(tty);
 
 	tty->closing = 0;
 	info->event = 0;
@@ -1303,9 +1297,7 @@ static void mxser_flush_buffer(struct tt
 	spin_unlock_irqrestore(&info->slock, flags);
 	/* above added by shinhay */
 
-	wake_up_interruptible(&tty->write_wait);
-	if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup)
-		(tty->ldisc.write_wakeup) (tty);
+	tty_wakeup(tty);
 }
 
 /*