Merge branch 'master' into for_paulus
[linux-drm-fsl-dcu.git] / drivers / char / n_tty.c
index b9371d5bf7906b48d4b340c5a8756c3fa132f516..6ac3ca4c723c2c660c5d084b9c7834035767fbb5 100644 (file)
@@ -579,8 +579,8 @@ static void eraser(unsigned char c, struct tty_struct *tty)
  
 static inline void isig(int sig, struct tty_struct *tty, int flush)
 {
-       if (tty->pgrp > 0)
-               kill_pg(tty->pgrp, sig, 1);
+       if (tty->pgrp)
+               kill_pgrp(tty->pgrp, sig, 1);
        if (flush || !L_NOFLSH(tty)) {
                n_tty_flush_buffer(tty);
                if (tty->driver->flush_buffer)
@@ -994,7 +994,7 @@ int is_ignored(int sig)
  *     when the ldisc is closed.
  */
  
-static void n_tty_set_termios(struct tty_struct *tty, struct termios * old)
+static void n_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
 {
        if (!tty)
                return;
@@ -1132,7 +1132,7 @@ static inline int input_available_p(struct tty_struct *tty, int amt)
  *     buffer, and once to drain the space from the (physical) beginning of
  *     the buffer to head pointer.
  *
- *     Called under the tty->atomic_read_lock sem and with TTY_DONT_FLIP set
+ *     Called under the tty->atomic_read_lock sem
  *
  */
  
@@ -1151,7 +1151,6 @@ static int copy_from_read_buf(struct tty_struct *tty,
        n = min(*nr, n);
        spin_unlock_irqrestore(&tty->read_lock, flags);
        if (n) {
-               mb();
                retval = copy_to_user(*b, &tty->read_buf[tty->read_tail], n);
                n -= retval;
                spin_lock_irqsave(&tty->read_lock, flags);
@@ -1185,13 +1184,13 @@ static int job_control(struct tty_struct *tty, struct file *file)
        /* don't stop on /dev/console */
        if (file->f_op->write != redirected_tty_write &&
            current->signal->tty == tty) {
-               if (tty->pgrp <= 0)
-                       printk("read_chan: tty->pgrp <= 0!\n");
-               else if (process_group(current) != tty->pgrp) {
+               if (!tty->pgrp)
+                       printk("read_chan: no tty->pgrp!\n");
+               else if (task_pgrp(current) != tty->pgrp) {
                        if (is_ignored(SIGTTIN) ||
-                           is_orphaned_pgrp(process_group(current)))
+                           is_current_pgrp_orphaned())
                                return -EIO;
-                       kill_pg(process_group(current), SIGTTIN, 1);
+                       kill_pgrp(task_pgrp(current), SIGTTIN, 1);
                        return -ERESTARTSYS;
                }
        }
@@ -1271,7 +1270,6 @@ do_it_again:
        }
 
        add_wait_queue(&tty->read_wait, &wait);
-       set_bit(TTY_DONT_FLIP, &tty->flags);
        while (nr) {
                /* First test for status change. */
                if (tty->packet && tty->link->ctrl_status) {
@@ -1315,9 +1313,7 @@ do_it_again:
                                break;
                        }
                        n_tty_set_room(tty);
-                       clear_bit(TTY_DONT_FLIP, &tty->flags);
                        timeout = schedule_timeout(timeout);
-                       set_bit(TTY_DONT_FLIP, &tty->flags);
                        continue;
                }
                __set_current_state(TASK_RUNNING);
@@ -1394,7 +1390,6 @@ do_it_again:
                if (time)
                        timeout = time;
        }
-       clear_bit(TTY_DONT_FLIP, &tty->flags);
        mutex_unlock(&tty->atomic_read_lock);
        remove_wait_queue(&tty->read_wait, &wait);