summaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_ldisc.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-11 07:41:03 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-28 00:01:44 +0100
commit6ffeb4b2782b31f3d7158795a451ad371955e8a2 (patch)
treed916a0ca6a8629aaa6e3f8df1757f26fbba1ed83 /drivers/tty/tty_ldisc.c
parenttty: Handle NULL tty->ldisc (diff)
downloadlinux-6ffeb4b2782b31f3d7158795a451ad371955e8a2.tar.xz
linux-6ffeb4b2782b31f3d7158795a451ad371955e8a2.zip
tty: Move tty_ldisc_kill()
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>
Diffstat (limited to 'drivers/tty/tty_ldisc.c')
-rw-r--r--drivers/tty/tty_ldisc.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 982af70c95ce..eac33e104ccc 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -601,6 +601,25 @@ err:
}
/**
+ * 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)