Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[firefly-linux-kernel-4.4.55.git] / drivers / tty / pty.c
index b38a28bd95116fd916fc3e685e270887ed59139e..25c9bc7837229abc2fb527732386111fb21194f0 100644 (file)
@@ -121,10 +121,8 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
                /* Stuff the data into the input queue of the other end */
                c = tty_insert_flip_string(to->port, buf, c);
                /* And shovel */
-               if (c) {
+               if (c)
                        tty_flip_buffer_push(to->port);
-                       tty_wakeup(tty);
-               }
        }
        return c;
 }
@@ -283,7 +281,7 @@ static int pty_resize(struct tty_struct *tty,  struct winsize *ws)
        struct tty_struct *pty = tty->link;
 
        /* For a PTY we need to lock the tty side */
-       down_write(&tty->termios_rwsem);
+       mutex_lock(&tty->winsize_mutex);
        if (!memcmp(ws, &tty->winsize, sizeof(*ws)))
                goto done;
 
@@ -310,7 +308,7 @@ static int pty_resize(struct tty_struct *tty,  struct winsize *ws)
        tty->winsize = *ws;
        pty->winsize = *ws;     /* Never used so will go away soon */
 done:
-       up_write(&tty->termios_rwsem);
+       mutex_unlock(&tty->winsize_mutex);
        return 0;
 }