* [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular
@ 2015-08-09 0:51 Paul Gortmaker
2015-08-09 0:51 ` [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c " Paul Gortmaker
0 siblings, 1 reply; 5+ messages in thread
From: Paul Gortmaker @ 2015-08-09 0:51 UTC (permalink / raw)
To: linux-arm-kernel
This second set of patches to drivers/tty steps outside of the serial
dir, and an improved auditing finds two more serial drivers pretending
to be modular that really are not.
The reasoning for doing this is the same as the first set[1] of patches
and is largely copied below:
In the previous merge window, we made changes to allow better
delineation between modular and non-modular code in commit
0fd972a7d91d6e15393c449492a04d94c0b89351 ("module: relocate module_init
from init.h to module.h"). This allows us to now ensure module code
looks modular and non-modular code does not accidentally look modular
without suffering build breakage.
Here we target code that is, by nature of their Kconfig settings, only
available to be built-in, but implicitly presenting itself as being
possibly modular by way of using modular headers, macros, and functions.
The goal here is to remove that illusion of modularity from these
drivers, but in a way that leaves the actual runtime unchanged.
In doing so, we remove code that has never been tested and adds
no value to the tree. And we begin the process of expecting a
level of consistency between the Kconfig of a driver and the code
that the driver uses.
Build tested for allyesconfig on x86_64, and ARM for lpc81xx, and powerpc
for hvc_console and mpsc, layered onto tty/tty-next as a baseline.
Paul.
[1] https://lkml.kernel.org/r/1437530538-5078-1-git-send-email-paul.gortmaker at windriver.com
--
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-serial at vger.kernel.org
Paul Gortmaker (5):
drivers/tty: make pty.c slightly more explicitly non-modular
drivers/tty: make sysrq.c slightly more explicitly non-modular
drivers/tty: make hvc_console.c explicitly non-modular
drivers/tty: make serial/mpsc.c driver explicitly non-modular
drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular
drivers/tty/hvc/hvc_console.c | 18 +----------------
drivers/tty/pty.c | 7 +++++--
drivers/tty/serial/8250/8250_lpc18xx.c | 19 ++++--------------
drivers/tty/serial/mpsc.c | 36 +++-------------------------------
drivers/tty/sysrq.c | 6 +++++-
5 files changed, 18 insertions(+), 68 deletions(-)
--
2.5.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular
2015-08-09 0:51 [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular Paul Gortmaker
@ 2015-08-09 0:51 ` Paul Gortmaker
2015-08-10 18:42 ` Joachim Eastwood
0 siblings, 1 reply; 5+ messages in thread
From: Paul Gortmaker @ 2015-08-09 0:51 UTC (permalink / raw)
To: linux-arm-kernel
The Kconfig currently controlling compilation of this code is:
8250/Kconfig:config SERIAL_8250_LPC18XX
8250/Kconfig: bool "NXP LPC18xx/43xx serial port support"
...meaning that it currently is not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.
Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.
Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
We leave some tags like MODULE_AUTHOR for documentation purposes.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: linux-serial at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/tty/serial/8250/8250_lpc18xx.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_lpc18xx.c b/drivers/tty/serial/8250/8250_lpc18xx.c
index 99cd478851ff..f5112bee1ab6 100644
--- a/drivers/tty/serial/8250/8250_lpc18xx.c
+++ b/drivers/tty/serial/8250/8250_lpc18xx.c
@@ -15,7 +15,7 @@
#include <linux/clk.h>
#include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -198,33 +198,22 @@ dis_clk_reg:
return ret;
}
-static int lpc18xx_serial_remove(struct platform_device *pdev)
-{
- struct lpc18xx_uart_data *data = platform_get_drvdata(pdev);
-
- serial8250_unregister_port(data->line);
- clk_disable_unprepare(data->clk_uart);
- clk_disable_unprepare(data->clk_reg);
-
- return 0;
-}
-
static const struct of_device_id lpc18xx_serial_match[] = {
{ .compatible = "nxp,lpc1850-uart" },
{ },
};
-MODULE_DEVICE_TABLE(of, lpc18xx_serial_match);
static struct platform_driver lpc18xx_serial_driver = {
.probe = lpc18xx_serial_probe,
- .remove = lpc18xx_serial_remove,
.driver = {
.name = "lpc18xx-uart",
.of_match_table = lpc18xx_serial_match,
},
};
-module_platform_driver(lpc18xx_serial_driver);
+builtin_platform_driver(lpc18xx_serial_driver);
+/*
MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
MODULE_DESCRIPTION("Serial port driver NXP LPC18xx/43xx devices");
MODULE_LICENSE("GPL v2");
+*/
--
2.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular
2015-08-09 0:51 ` [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c " Paul Gortmaker
@ 2015-08-10 18:42 ` Joachim Eastwood
2015-08-11 6:05 ` Paul Gortmaker
0 siblings, 1 reply; 5+ messages in thread
From: Joachim Eastwood @ 2015-08-10 18:42 UTC (permalink / raw)
To: linux-arm-kernel
Hi Paul,
On 9 August 2015 at 02:51, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> The Kconfig currently controlling compilation of this code is:
>
> 8250/Kconfig:config SERIAL_8250_LPC18XX
> 8250/Kconfig: bool "NXP LPC18xx/43xx serial port support"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
The bool in KConfig is more or less a copy-paste mistake on my side. I
really meant for this driver to be buildable as module and it builds
just fine with 'm'.
Want me send a patch changing it to tristate or will you handle it?
regards,
Joachim Eastwood
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular
2015-08-10 18:42 ` Joachim Eastwood
@ 2015-08-11 6:05 ` Paul Gortmaker
2015-08-15 0:16 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Paul Gortmaker @ 2015-08-11 6:05 UTC (permalink / raw)
To: linux-arm-kernel
[Re: [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular] On 10/08/2015 (Mon 20:42) Joachim Eastwood wrote:
> Hi Paul,
>
> On 9 August 2015 at 02:51, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> > The Kconfig currently controlling compilation of this code is:
> >
> > 8250/Kconfig:config SERIAL_8250_LPC18XX
> > 8250/Kconfig: bool "NXP LPC18xx/43xx serial port support"
> >
> > ...meaning that it currently is not being built as a module by anyone.
> >
> > Lets remove the modular code that is essentially orphaned, so that
> > when reading the driver there is no doubt it is builtin-only.
>
> The bool in KConfig is more or less a copy-paste mistake on my side. I
> really meant for this driver to be buildable as module and it builds
> just fine with 'm'.
>
> Want me send a patch changing it to tristate or will you handle it?
I will do a v2 in the next day or so with collected ACKs and this patch
replaced, unless Greg jumps in and indicates he'd like something
different.
Paul.
--
>
>
> regards, Joachim Eastwood
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular
2015-08-11 6:05 ` Paul Gortmaker
@ 2015-08-15 0:16 ` Greg Kroah-Hartman
0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2015-08-15 0:16 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Aug 11, 2015 at 02:05:44AM -0400, Paul Gortmaker wrote:
> [Re: [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular] On 10/08/2015 (Mon 20:42) Joachim Eastwood wrote:
>
> > Hi Paul,
> >
> > On 9 August 2015 at 02:51, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> > > The Kconfig currently controlling compilation of this code is:
> > >
> > > 8250/Kconfig:config SERIAL_8250_LPC18XX
> > > 8250/Kconfig: bool "NXP LPC18xx/43xx serial port support"
> > >
> > > ...meaning that it currently is not being built as a module by anyone.
> > >
> > > Lets remove the modular code that is essentially orphaned, so that
> > > when reading the driver there is no doubt it is builtin-only.
> >
> > The bool in KConfig is more or less a copy-paste mistake on my side. I
> > really meant for this driver to be buildable as module and it builds
> > just fine with 'm'.
> >
> > Want me send a patch changing it to tristate or will you handle it?
>
> I will do a v2 in the next day or so with collected ACKs and this patch
> replaced, unless Greg jumps in and indicates he'd like something
> different.
Nope, that would be fine with me, thanks.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-15 0:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-09 0:51 [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular Paul Gortmaker
2015-08-09 0:51 ` [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c " Paul Gortmaker
2015-08-10 18:42 ` Joachim Eastwood
2015-08-11 6:05 ` Paul Gortmaker
2015-08-15 0:16 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).