]> git.karo-electronics.de Git - linux-beck.git/commitdiff
tty: Eliminate global symbol tty_ldisc_N_TTY
authorPeter Hurley <peter@hurleysoftware.com>
Sun, 10 Jan 2016 05:35:19 +0000 (21:35 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2016 23:13:28 +0000 (15:13 -0800)
Reduce global tty symbols; move and rename tty_ldisc_begin() as
n_tty_init() and redefine the N_TTY ldisc ops as file scope.

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

index 90eca2605fbf43516f0dfbd37bc3d4b165d1ee89..dae628f199125fc8ab4076767f72f8a31c1d0e9d 100644 (file)
@@ -2497,7 +2497,7 @@ static void n_tty_fasync(struct tty_struct *tty, int on)
        }
 }
 
-struct tty_ldisc_ops tty_ldisc_N_TTY = {
+static struct tty_ldisc_ops n_tty_ops = {
        .magic           = TTY_LDISC_MAGIC,
        .name            = "n_tty",
        .open            = n_tty_open,
@@ -2518,14 +2518,18 @@ struct tty_ldisc_ops tty_ldisc_N_TTY = {
  *     n_tty_inherit_ops       -       inherit N_TTY methods
  *     @ops: struct tty_ldisc_ops where to save N_TTY methods
  *
- *     Enables a 'subclass' line discipline to 'inherit' N_TTY
- *     methods.
+ *     Enables a 'subclass' line discipline to 'inherit' N_TTY methods.
  */
 
 void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
 {
-       *ops = tty_ldisc_N_TTY;
+       *ops = n_tty_ops;
        ops->owner = NULL;
        ops->refcount = ops->flags = 0;
 }
 EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
+
+void __init n_tty_init(void)
+{
+       tty_register_ldisc(N_TTY, &n_tty_ops);
+}
index cb0a0c82279b96205fadee986db60520cead46ed..798acb690092c393aaf78c2451347044d2bf295e 100644 (file)
@@ -3576,7 +3576,7 @@ void __init console_init(void)
        initcall_t *call;
 
        /* Setup the default TTY line discipline. */
-       tty_ldisc_begin();
+       n_tty_init();
 
        /*
         * set up the console device so that later boot sequences can
index 4cb5e572c7b8fb8fe046c985a7cb31ccdea2d346..68947f6de5ad6339adea804182597229c3eb1d38 100644 (file)
@@ -824,9 +824,3 @@ void tty_ldisc_deinit(struct tty_struct *tty)
                tty_ldisc_put(tty->ldisc);
        tty->ldisc = NULL;
 }
-
-void tty_ldisc_begin(void)
-{
-       /* Setup the default TTY line discipline. */
-       (void) tty_register_ldisc(N_TTY, &tty_ldisc_N_TTY);
-}
index 95e52c6b9696ff30001dac2fee88ff27c2da0c66..f6c07fd12ef466bfdcb81470a39675f7f1d6ae7a 100644 (file)
@@ -576,7 +576,6 @@ extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty);
 extern void tty_ldisc_release(struct tty_struct *tty);
 extern void tty_ldisc_init(struct tty_struct *tty);
 extern void tty_ldisc_deinit(struct tty_struct *tty);
-extern void tty_ldisc_begin(void);
 
 static inline int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p,
                                        char *f, int count)
@@ -593,8 +592,8 @@ static inline int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p,
 
 
 /* n_tty.c */
-extern struct tty_ldisc_ops tty_ldisc_N_TTY;
 extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
+extern void __init n_tty_init(void);
 
 /* tty_audit.c */
 #ifdef CONFIG_AUDIT