tty: Move tty_ldisc_kill()
authorPeter Hurley <peter@hurleysoftware.com>
Mon, 11 Jan 2016 06:41:03 +0000 (22:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2016 23:01:44 +0000 (15:01 -0800)
In preparation for destroying the line discipline instance on hangup,
move tty_ldisc_kill() to eliminate needless forward declarations.
No functional change.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ldisc.c

index 982af70c95ce48d0a531e297ecf1610466697fe3..eac33e104ccc29603de52b581a60e544c2dfca71 100644 (file)
@@ -600,6 +600,25 @@ err:
        return retval;
 }
 
+/**
+ *     tty_ldisc_kill  -       teardown ldisc
+ *     @tty: tty being released
+ *
+ *     Perform final close of the ldisc and reset tty->ldisc
+ */
+static void tty_ldisc_kill(struct tty_struct *tty)
+{
+       if (!tty->ldisc)
+               return;
+       /*
+        * Now kill off the ldisc
+        */
+       tty_ldisc_close(tty, tty->ldisc);
+       tty_ldisc_put(tty->ldisc);
+       /* Force an oops if we mess this up */
+       tty->ldisc = NULL;
+}
+
 /**
  *     tty_reset_termios       -       reset terminal state
  *     @tty: tty to reset
@@ -747,19 +766,6 @@ int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty)
        return 0;
 }
 
-static void tty_ldisc_kill(struct tty_struct *tty)
-{
-       if (!tty->ldisc)
-               return;
-       /*
-        * Now kill off the ldisc
-        */
-       tty_ldisc_close(tty, tty->ldisc);
-       tty_ldisc_put(tty->ldisc);
-       /* Force an oops if we mess this up */
-       tty->ldisc = NULL;
-}
-
 /**
  *     tty_ldisc_release               -       release line discipline
  *     @tty: tty being shut down (or one end of pty pair)