]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/tty/pty.c
Merge remote-tracking branch 'tty/tty-next'
[karo-tx-linux.git] / drivers / tty / pty.c
index 2348fa6137070e19c19d97a5dc436b1a0b762441..e16a49b507efbd57734b0b8f522d0e2a5dfe03ce 100644 (file)
@@ -263,8 +263,7 @@ static void pty_set_termios(struct tty_struct *tty,
 {
        /* See if packet mode change of state. */
        if (tty->link && tty->link->packet) {
-               int extproc = (old_termios->c_lflag & EXTPROC) |
-                               (tty->termios.c_lflag & EXTPROC);
+               int extproc = (old_termios->c_lflag & EXTPROC) | L_EXTPROC(tty);
                int old_flow = ((old_termios->c_iflag & IXON) &&
                                (old_termios->c_cc[VSTOP] == '\023') &&
                                (old_termios->c_cc[VSTART] == '\021'));
@@ -406,13 +405,8 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty,
        if (legacy) {
                /* We always use new tty termios data so we can do this
                   the easy way .. */
-               retval = tty_init_termios(tty);
-               if (retval)
-                       goto err_deinit_tty;
-
-               retval = tty_init_termios(o_tty);
-               if (retval)
-                       goto err_free_termios;
+               tty_init_termios(tty);
+               tty_init_termios(o_tty);
 
                driver->other->ttys[idx] = o_tty;
                driver->ttys[idx] = tty;
@@ -444,12 +438,7 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty,
        tty->count++;
        o_tty->count++;
        return 0;
-err_free_termios:
-       if (legacy)
-               tty_free_termios(tty);
-err_deinit_tty:
-       deinitialize_tty_struct(o_tty);
-       free_tty_struct(o_tty);
+
 err_put_module:
        module_put(driver->other->owner);
 err:
@@ -666,20 +655,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)
 {
        struct inode *ptmx_inode;
 
@@ -704,7 +686,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
 };
 
@@ -722,7 +703,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,
 };