Skip to content

Commit c1e33af

Browse files
peterhurleygregkh
authored andcommitted
pty: Remove pty_unix98_shutdown()
The tty core invokes the optional driver shutdown() just before the optional driver remove() (shutdown() has access to the termios and remove() does not). Because pty drivers must prevent the default remove() action, the Unix98 pty drivers define a dummy remove() function. Instead, release the slave index in the remove() method and delete the optional shutdown() method. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 05de87e commit c1e33af

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/tty/pty.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -656,20 +656,13 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
656656
return tty;
657657
}
658658

659-
/* We have no need to install and remove our tty objects as devpts does all
660-
the work for us */
661-
662659
static int pty_unix98_install(struct tty_driver *driver, struct tty_struct *tty)
663660
{
664661
return pty_common_install(driver, tty, false);
665662
}
666663

667-
static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
668-
{
669-
}
670-
671664
/* this is called once with whichever end is closed last */
672-
static void pty_unix98_shutdown(struct tty_struct *tty)
665+
static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
673666
{
674667
devpts_kill_index(tty->driver_data, tty->index);
675668
}
@@ -687,7 +680,6 @@ static const struct tty_operations ptm_unix98_ops = {
687680
.unthrottle = pty_unthrottle,
688681
.ioctl = pty_unix98_ioctl,
689682
.resize = pty_resize,
690-
.shutdown = pty_unix98_shutdown,
691683
.cleanup = pty_cleanup
692684
};
693685

@@ -705,7 +697,6 @@ static const struct tty_operations pty_unix98_ops = {
705697
.set_termios = pty_set_termios,
706698
.start = pty_start,
707699
.stop = pty_stop,
708-
.shutdown = pty_unix98_shutdown,
709700
.cleanup = pty_cleanup,
710701
};
711702

0 commit comments

Comments
 (0)