aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/tty_io.c2
-rw-r--r--drivers/tty/tty_ldisc.c15
-rw-r--r--include/linux/tty.h2
3 files changed, 9 insertions, 10 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index f5b62b99489d..cd9550820a58 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1892,7 +1892,7 @@ int tty_release(struct inode *inode, struct file *filp)
1892 /* 1892 /*
1893 * Ask the line discipline code to release its structures 1893 * Ask the line discipline code to release its structures
1894 */ 1894 */
1895 tty_ldisc_release(tty, o_tty); 1895 tty_ldisc_release(tty);
1896 1896
1897 /* Wait for pending work before tty destruction commmences */ 1897 /* Wait for pending work before tty destruction commmences */
1898 tty_flush_works(tty); 1898 tty_flush_works(tty);
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 49001fa2ea2f..1c4d7b6d8a76 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -756,18 +756,17 @@ static void tty_ldisc_kill(struct tty_struct *tty)
756 756
757/** 757/**
758 * tty_ldisc_release - release line discipline 758 * tty_ldisc_release - release line discipline
759 * @tty: tty being shut down 759 * @tty: tty being shut down (or one end of pty pair)
760 * @o_tty: pair tty for pty/tty pairs
761 *
762 * Called during the final close of a tty/pty pair in order to shut down
763 * the line discpline layer. On exit the ldisc assigned is N_TTY and the
764 * ldisc has not been opened.
765 * 760 *
766 * Holding ldisc_sem write lock serializes tty->ldisc changes. 761 * Called during the final close of a tty or a pty pair in order to shut
762 * down the line discpline layer. On exit, each ldisc assigned is N_TTY and
763 * each ldisc has not been opened.
767 */ 764 */
768 765
769void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty) 766void tty_ldisc_release(struct tty_struct *tty)
770{ 767{
768 struct tty_struct *o_tty = tty->link;
769
771 /* 770 /*
772 * Shutdown this line discipline. As this is the final close, 771 * Shutdown this line discipline. As this is the final close,
773 * it does not race with the set_ldisc code path. 772 * it does not race with the set_ldisc code path.
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 35b29f0750f8..af1a7f3e4e4a 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -557,7 +557,7 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
557extern int tty_unregister_ldisc(int disc); 557extern int tty_unregister_ldisc(int disc);
558extern int tty_set_ldisc(struct tty_struct *tty, int ldisc); 558extern int tty_set_ldisc(struct tty_struct *tty, int ldisc);
559extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty); 559extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty);
560extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty); 560extern void tty_ldisc_release(struct tty_struct *tty);
561extern void tty_ldisc_init(struct tty_struct *tty); 561extern void tty_ldisc_init(struct tty_struct *tty);
562extern void tty_ldisc_deinit(struct tty_struct *tty); 562extern void tty_ldisc_deinit(struct tty_struct *tty);
563extern void tty_ldisc_begin(void); 563extern void tty_ldisc_begin(void);