Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1305455
| From | Peter Hurley <peter@hurleysoftware.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 07/10] pty: Remove pty_unix98_shutdown() |
| Date | 2016-01-10 06:20 +0100 |
| Message-ID | <qPgA2-87H-13@gated-at.bofh.it> (permalink) |
| References | <qzDqV-2GJ-3@gated-at.bofh.it> <qPgA1-87H-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
---
drivers/tty/pty.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 7e885a2..be5020d 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -656,20 +656,13 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
return tty;
}
-/* We have no need to install and remove our tty objects as devpts does all
- the work for us */
-
static int pty_unix98_install(struct tty_driver *driver, struct tty_struct *tty)
{
return pty_common_install(driver, tty, false);
}
-static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
-{
-}
-
/* this is called once with whichever end is closed last */
-static void pty_unix98_shutdown(struct tty_struct *tty)
+static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
{
devpts_kill_index(tty->driver_data, tty->index);
}
@@ -687,7 +680,6 @@ static const struct tty_operations ptm_unix98_ops = {
.unthrottle = pty_unthrottle,
.ioctl = pty_unix98_ioctl,
.resize = pty_resize,
- .shutdown = pty_unix98_shutdown,
.cleanup = pty_cleanup
};
@@ -705,7 +697,6 @@ static const struct tty_operations pty_unix98_ops = {
.set_termios = pty_set_termios,
.start = pty_start,
.stop = pty_stop,
- .shutdown = pty_unix98_shutdown,
.cleanup = pty_cleanup,
};
--
2.7.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 00/10] Rework tty_reopen() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 01/10] tty: Wait interruptibly for tty lock on reopen Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 06/10] tty: Re-declare tty_driver_remove_tty() file scope Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 03/10] tty: Fix ldisc leak in failed tty_init_dev() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 05/10] tty: Fix tty_init_termios() declaration Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 04/10] tty: Remove !tty check from free_tty_struct() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 07/10] pty: Remove pty_unix98_shutdown() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 08/10] tty: Remove __lockfunc annotation from tty lock functions Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 02/10] tty: Retry failed reopen if tty teardown in-progress Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 09/10] tty: Consolidate noctty checks in tty_open() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100 [PATCH v2 10/10] tty: Refactor tty_open() Peter Hurley <peter@hurleysoftware.com> - 2016-01-10 06:20 +0100
csiph-web