All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>
Subject: [PATCH 1/5] drivers/tty: make pty.c slightly more explicitly non-modular
Date: Wed, 19 Aug 2015 17:48:05 -0400	[thread overview]
Message-ID: <1440020889-12120-2-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1440020889-12120-1-git-send-email-paul.gortmaker@windriver.com>

The Kconfig currently controlling compilation of this code is:

drivers/tty/Kconfig:config LEGACY_PTYS
drivers/tty/Kconfig:    bool "Legacy (BSD) PTY support"

...and:

drivers/tty/Kconfig:config UNIX98_PTYS
drivers/tty/Kconfig:    bool "Unix98 PTY support" if EXPERT

combined with this:

obj-$(CONFIG_LEGACY_PTYS)       += pty.o
obj-$(CONFIG_UNIX98_PTYS)       += pty.o

...meaning that it currently is not being built as a module by anyone.

Lets remove the traces of modularity we can so that when reading the
driver there is less doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We don't delete the module.h include since other parts of the file are
using content from there.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/tty/pty.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 4d5937c185c1..a45660f62db5 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -7,7 +7,6 @@
  */
 
 #include <linux/module.h>
-
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/tty.h>
@@ -501,6 +500,10 @@ static int pty_bsd_ioctl(struct tty_struct *tty,
 }
 
 static int legacy_count = CONFIG_LEGACY_PTY_COUNT;
+/*
+ * not really modular, but the easiest way to keep compat with existing
+ * bootargs behaviour is to continue using module_param here.
+ */
 module_param(legacy_count, int, 0);
 
 /*
@@ -877,4 +880,4 @@ static int __init pty_init(void)
 	unix98_pty_init();
 	return 0;
 }
-module_init(pty_init);
+device_initcall(pty_init);
-- 
2.5.0


  reply	other threads:[~2015-08-19 21:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 21:48 [PATCH v2 0/5] drivers/tty: make more bool drivers explicitly non-modular Paul Gortmaker
2015-08-19 21:48 ` Paul Gortmaker
2015-08-19 21:48 ` Paul Gortmaker
2015-08-19 21:48 ` Paul Gortmaker [this message]
2015-08-19 21:48 ` [PATCH 2/5] drivers/tty: make sysrq.c slightly more " Paul Gortmaker
2015-08-19 21:48 ` [PATCH 3/5] drivers/tty: make hvc_console.c " Paul Gortmaker
2015-08-19 21:48 ` [PATCH 4/5] drivers/tty: make serial/mpsc.c driver " Paul Gortmaker
2015-08-19 21:48   ` Paul Gortmaker
2015-10-09 13:38   ` Thierry Reding
2015-10-10 19:18     ` Paul Gortmaker
2015-10-10 19:18       ` Paul Gortmaker
2015-08-19 21:48 ` [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c Kconfig a tristate Paul Gortmaker
2015-08-19 21:48   ` Paul Gortmaker
2015-08-19 21:48   ` Paul Gortmaker
2015-08-20  6:58   ` Joachim Eastwood
2015-08-20  6:58     ` Joachim Eastwood
2015-08-20  6:58     ` Joachim Eastwood
2015-09-26 22:53 ` [PATCH v2 0/5] drivers/tty: make more bool drivers explicitly non-modular Paul Gortmaker
2015-09-26 22:53   ` Paul Gortmaker
2015-09-26 22:53   ` Paul Gortmaker
2015-09-27 19:42   ` Greg Kroah-Hartman
2015-09-27 19:42     ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2015-08-09  0:51 [PATCH " Paul Gortmaker
2015-08-09  0:51 ` [PATCH 1/5] drivers/tty: make pty.c slightly more " Paul Gortmaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440020889-12120-2-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.