rk: revert to v3.10
[firefly-linux-kernel-4.4.55.git] / drivers / tty / tty_io.c
index 3723c0ebb3161b6ae03560c44742a259de4f31eb..6464029e4860968945840c252ad632b556f9f947 100644 (file)
@@ -850,8 +850,7 @@ void disassociate_ctty(int on_exit)
                        struct pid *tty_pgrp = tty_get_pgrp(tty);
                        if (tty_pgrp) {
                                kill_pgrp(tty_pgrp, SIGHUP, on_exit);
-                               if (!on_exit)
-                                       kill_pgrp(tty_pgrp, SIGCONT, on_exit);
+                               kill_pgrp(tty_pgrp, SIGCONT, on_exit);
                                put_pid(tty_pgrp);
                        }
                }
@@ -1267,13 +1266,12 @@ static void pty_line_name(struct tty_driver *driver, int index, char *p)
  *
  *     Locking: None
  */
-static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p)
+static void tty_line_name(struct tty_driver *driver, int index, char *p)
 {
        if (driver->flags & TTY_DRIVER_UNNUMBERED_NODE)
-               return sprintf(p, "%s", driver->name);
+               strcpy(p, driver->name);
        else
-               return sprintf(p, "%s%d", driver->name,
-                              index + driver->name_base);
+               sprintf(p, "%s%d", driver->name, index + driver->name_base);
 }
 
 /**
@@ -1620,8 +1618,6 @@ static void release_tty(struct tty_struct *tty, int idx)
        tty_free_termios(tty);
        tty_driver_remove_tty(tty->driver, tty);
        tty->port->itty = NULL;
-       if (tty->link)
-               tty->link->port->itty = NULL;
        cancel_work_sync(&tty->port->buf.work);
 
        if (tty->link)
@@ -3539,19 +3535,9 @@ static ssize_t show_cons_active(struct device *dev,
                if (i >= ARRAY_SIZE(cs))
                        break;
        }
-       while (i--) {
-               int index = cs[i]->index;
-               struct tty_driver *drv = cs[i]->device(cs[i], &index);
-
-               /* don't resolve tty0 as some programs depend on it */
-               if (drv && (cs[i]->index > 0 || drv->major != TTY_MAJOR))
-                       count += tty_line_name(drv, index, buf + count);
-               else
-                       count += sprintf(buf + count, "%s%d",
-                                        cs[i]->name, cs[i]->index);
-
-               count += sprintf(buf + count, "%c", i ? ' ':'\n');
-       }
+       while (i--)
+               count += sprintf(buf + count, "%s%d%c",
+                                cs[i]->name, cs[i]->index, i ? ' ':'\n');
        console_unlock();
 
        return count;