tty: Simplify tty_ldisc_release() interface
Passing the 'other' tty to tty_ldisc_release() only makes sense for a pty pair; make o_tty function local instead. Reviewed-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
949aa64ff9
commit
62462aefeb
3 changed files with 9 additions and 10 deletions
|
@ -1892,7 +1892,7 @@ int tty_release(struct inode *inode, struct file *filp)
|
||||||
/*
|
/*
|
||||||
* Ask the line discipline code to release its structures
|
* Ask the line discipline code to release its structures
|
||||||
*/
|
*/
|
||||||
tty_ldisc_release(tty, o_tty);
|
tty_ldisc_release(tty);
|
||||||
|
|
||||||
/* Wait for pending work before tty destruction commmences */
|
/* Wait for pending work before tty destruction commmences */
|
||||||
tty_flush_works(tty);
|
tty_flush_works(tty);
|
||||||
|
|
|
@ -756,18 +756,17 @@ static void tty_ldisc_kill(struct tty_struct *tty)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tty_ldisc_release - release line discipline
|
* tty_ldisc_release - release line discipline
|
||||||
* @tty: tty being shut down
|
* @tty: tty being shut down (or one end of pty pair)
|
||||||
* @o_tty: pair tty for pty/tty pairs
|
|
||||||
*
|
*
|
||||||
* Called during the final close of a tty/pty pair in order to shut down
|
* Called during the final close of a tty or a pty pair in order to shut
|
||||||
* the line discpline layer. On exit the ldisc assigned is N_TTY and the
|
* down the line discpline layer. On exit, each ldisc assigned is N_TTY and
|
||||||
* ldisc has not been opened.
|
* each ldisc has not been opened.
|
||||||
*
|
|
||||||
* Holding ldisc_sem write lock serializes tty->ldisc changes.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty)
|
void tty_ldisc_release(struct tty_struct *tty)
|
||||||
{
|
{
|
||||||
|
struct tty_struct *o_tty = tty->link;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shutdown this line discipline. As this is the final close,
|
* Shutdown this line discipline. As this is the final close,
|
||||||
* it does not race with the set_ldisc code path.
|
* it does not race with the set_ldisc code path.
|
||||||
|
|
|
@ -557,7 +557,7 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
|
||||||
extern int tty_unregister_ldisc(int disc);
|
extern int tty_unregister_ldisc(int disc);
|
||||||
extern int tty_set_ldisc(struct tty_struct *tty, int ldisc);
|
extern int tty_set_ldisc(struct tty_struct *tty, int ldisc);
|
||||||
extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty);
|
extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty);
|
||||||
extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty);
|
extern void tty_ldisc_release(struct tty_struct *tty);
|
||||||
extern void tty_ldisc_init(struct tty_struct *tty);
|
extern void tty_ldisc_init(struct tty_struct *tty);
|
||||||
extern void tty_ldisc_deinit(struct tty_struct *tty);
|
extern void tty_ldisc_deinit(struct tty_struct *tty);
|
||||||
extern void tty_ldisc_begin(void);
|
extern void tty_ldisc_begin(void);
|
||||||
|
|
Loading…
Add table
Reference in a new issue