Merge remote branch 'origin/master' of ../linux-2.6 into drm-next
[firefly-linux-kernel-4.4.55.git] / drivers / char / pty.c
index 3850a68f265ae56ef8fd601d1ca36bf12b339f31..b33d6688e9109a31bb27a6b297a73a8e69c5989d 100644 (file)
@@ -52,7 +52,6 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
                return;
        tty->link->packet = 0;
        set_bit(TTY_OTHER_CLOSED, &tty->link->flags);
-       tty_flip_buffer_push(tty->link);
        wake_up_interruptible(&tty->link->read_wait);
        wake_up_interruptible(&tty->link->write_wait);
        if (tty->driver->subtype == PTY_TYPE_MASTER) {
@@ -110,21 +109,13 @@ static int pty_space(struct tty_struct *to)
  *     the other side of the pty/tty pair.
  */
 
-static int pty_write(struct tty_struct *tty, const unsigned char *buf,
-                                                               int count)
+static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
 {
        struct tty_struct *to = tty->link;
-       int c;
 
        if (tty->stopped)
                return 0;
 
-       /* This isn't locked but our 8K is quite sloppy so no
-          big deal */
-
-       c = pty_space(to);
-       if (c > count)
-               c = count;
        if (c > 0) {
                /* Stuff the data into the input queue of the other end */
                c = tty_insert_flip_string(to, buf, c);
@@ -145,6 +136,8 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf,
 
 static int pty_write_room(struct tty_struct *tty)
 {
+       if (tty->stopped)
+               return 0;
        return pty_space(tty->link);
 }
 
@@ -208,7 +201,6 @@ static int pty_open(struct tty_struct *tty, struct file *filp)
        clear_bit(TTY_OTHER_CLOSED, &tty->link->flags);
        set_bit(TTY_THROTTLED, &tty->flags);
        retval = 0;
-       tty->low_latency = 1;
 out:
        return retval;
 }