Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1424563 > unrolled thread
| Started by | Paul Gortmaker <paul.gortmaker@windriver.com> |
|---|---|
| First post | 2016-06-17 02:40 +0200 |
| Last post | 2016-06-17 02:50 +0200 |
| Articles | 6 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/6] memory: remove modular usage from non-modular drivers Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-06-17 02:40 +0200
[PATCH 6/6] memory: atmel-ebi: make it explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-06-17 02:40 +0200
Re: [PATCH 6/6] memory: atmel-ebi: make it explicitly non-modular Nicolas Ferre <nicolas.ferre@atmel.com> - 2016-06-17 09:40 +0200
Re: [PATCH 6/6] memory: atmel-ebi: make it explicitly non-modular Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-06-17 09:40 +0200
Re: [PATCH 6/6] memory: atmel-ebi: make it explicitly non-modular Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-06-21 17:30 +0200
[PATCH 2/6] memory: mvebu-devbus: make it explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-06-17 02:50 +0200
| From | Paul Gortmaker <paul.gortmaker@windriver.com> |
|---|---|
| Date | 2016-06-17 02:40 +0200 |
| Subject | [PATCH 0/6] memory: remove modular usage from non-modular drivers |
| Message-ID | <rKPZf-7Fj-5@gated-at.bofh.it> |
It seems that drivers/memory/ doesn't have a single maintainer, so please
feel free to pick up just one or two patches from this as appropriate.
For anyone new to the underlying goal of this cleanup, we are trying to
not use module support for code that can never be built as a module since:
(1) it is easy to accidentally write unused module_exit and remove code
(2) it can be misleading when reading the source, thinking it can be
modular when the Makefile and/or Kconfig prohibit it
(3) it requires the include of the module.h header file which in turn
includes nearly everything else, thus adding to CPP overhead.
(4) it gets copied/replicated into other code and spreads like weeds.
Changes seen here cover the following categories:
-just replacement of modular macros with their non-modular
equivalents that CPP would have inserted anyway
-the removal of including module.h ; replaced with init.h
as required based on whether the file already had it.
-the removal of any/all unused/orphaned __exit functions
that would never be called/exercised.
-the removal of any ".remove" functions that were hooked into
the driver struct. This ".remove" function would of
course not be called from the __exit function since that was
never run. However in theory, someone could have triggered it
via sysfs unbind, even though there isn't a sensible use case
for doing so. So to cover that possibility, we've also disabled
sysfs unbind in these drivers.
There are no initcall level changes here; everything continues to
use the level of initcall it had before. So no risk of regressions
from that exists here.
Build tested for several different key arch on a recent linux-next
tree to ensure no silly typos crept in.
FAQ: Why not make it tristate?
------------------------------
Upon detecting a non-modular driver making modular references, I don't
immediately convert them to tristate, since it increases functionality
that I can't readily test, and it may not have a sensible use case (e.g.
in the case of core arch support relating to timer ticks or similar.)
So instead the modular references are removed w/o changing the existing
functionality by default.
However there is no reason the original author or an interested user
with the capability to test can't nominate a driver to be tristate
either as the original intent, or as a functional and tested use case.
Paul.
---
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Pankaj Dubey <pankaj.dubey@samsung.com>
Cc: Roger Quadros <rogerq@ti.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Paul Gortmaker (6):
memory: atmel-sdramc: make it explicitly non-modular
memory: mvebu-devbus: make it explicitly non-modular
memory: omap-gpmc: make it explicitly non-modular
memory: tegra20-mc: make it explicitly non-modular
memory: samsung/exynos-srom: make it explicitly non-modular
memory: atmel-ebi: make it explicitly non-modular
drivers/memory/atmel-ebi.c | 9 ++-------
drivers/memory/atmel-sdramc.c | 11 ++++-------
drivers/memory/mvebu-devbus.c | 11 ++++-------
drivers/memory/omap-gpmc.c | 10 ----------
drivers/memory/samsung/exynos-srom.c | 21 +++------------------
drivers/memory/tegra20-mc.c | 11 ++++-------
6 files changed, 17 insertions(+), 56 deletions(-)
--
2.8.4
[toc] | [next] | [standalone]
| From | Paul Gortmaker <paul.gortmaker@windriver.com> |
|---|---|
| Date | 2016-06-17 02:40 +0200 |
| Subject | [PATCH 6/6] memory: atmel-ebi: make it explicitly non-modular |
| Message-ID | <rKPZf-7Fj-23@gated-at.bofh.it> |
| In reply to | #1424563 |
The Kconfig currently controlling compilation of this code is:
drivers/memory/Kconfig:config ATMEL_EBI
drivers/memory/Kconfig: bool "Atmel EBI driver"
...meaning that it currently is not being built as a module by anyone.
Lets remove the few remaining modular references, 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 also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/memory/atmel-ebi.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index 17d9d3f60f20..f87ad6f5d2dc 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -14,7 +14,7 @@
#include <linux/mfd/syscon.h>
#include <linux/mfd/syscon/atmel-matrix.h>
#include <linux/mfd/syscon/atmel-smc.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
@@ -648,7 +648,6 @@ static const struct of_device_id at91_ebi_id_table[] = {
},
{ /* sentinel */ }
};
-MODULE_DEVICE_TABLE(of, at91_ebi_id_table);
static int at91_ebi_dev_disable(struct at91_ebi *ebi, struct device_node *np)
{
@@ -764,8 +763,4 @@ static struct platform_driver at91_ebi_driver = {
.of_match_table = at91_ebi_id_table,
},
};
-module_platform_driver_probe(at91_ebi_driver, at91_ebi_probe);
-
-MODULE_AUTHOR("Jean-Jacques Hiblot <jjhiblot@traphandler.com>");
-MODULE_DESCRIPTION("Atmel EBI driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver_probe(at91_ebi_driver, at91_ebi_probe);
--
2.8.4
[toc] | [prev] | [next] | [standalone]
| From | Nicolas Ferre <nicolas.ferre@atmel.com> |
|---|---|
| Date | 2016-06-17 09:40 +0200 |
| Subject | Re: [PATCH 6/6] memory: atmel-ebi: make it explicitly non-modular |
| Message-ID | <rKWxI-3yM-15@gated-at.bofh.it> |
| In reply to | #1424564 |
Le 17/06/2016 02:37, Paul Gortmaker a écrit :
> The Kconfig currently controlling compilation of this code is:
>
> drivers/memory/Kconfig:config ATMEL_EBI
> drivers/memory/Kconfig: bool "Atmel EBI driver"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the few remaining modular references, 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 also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Cc: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
We'll have to take the two atmel-related drivers through our git trees
and arm-soc.
Thanks Paul. Bye.
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> drivers/memory/atmel-ebi.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
> index 17d9d3f60f20..f87ad6f5d2dc 100644
> --- a/drivers/memory/atmel-ebi.c
> +++ b/drivers/memory/atmel-ebi.c
> @@ -14,7 +14,7 @@
> #include <linux/mfd/syscon.h>
> #include <linux/mfd/syscon/atmel-matrix.h>
> #include <linux/mfd/syscon/atmel-smc.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
> #include <linux/of_device.h>
> #include <linux/regmap.h>
>
> @@ -648,7 +648,6 @@ static const struct of_device_id at91_ebi_id_table[] = {
> },
> { /* sentinel */ }
> };
> -MODULE_DEVICE_TABLE(of, at91_ebi_id_table);
>
> static int at91_ebi_dev_disable(struct at91_ebi *ebi, struct device_node *np)
> {
> @@ -764,8 +763,4 @@ static struct platform_driver at91_ebi_driver = {
> .of_match_table = at91_ebi_id_table,
> },
> };
> -module_platform_driver_probe(at91_ebi_driver, at91_ebi_probe);
> -
> -MODULE_AUTHOR("Jean-Jacques Hiblot <jjhiblot@traphandler.com>");
> -MODULE_DESCRIPTION("Atmel EBI driver");
> -MODULE_LICENSE("GPL");
> +builtin_platform_driver_probe(at91_ebi_driver, at91_ebi_probe);
>
--
Nicolas Ferre
[toc] | [prev] | [next] | [standalone]
| From | Boris Brezillon <boris.brezillon@free-electrons.com> |
|---|---|
| Date | 2016-06-17 09:40 +0200 |
| Subject | Re: [PATCH 6/6] memory: atmel-ebi: make it explicitly non-modular |
| Message-ID | <rKWxI-3yM-17@gated-at.bofh.it> |
| In reply to | #1424749 |
On Fri, 17 Jun 2016 09:35:42 +0200
Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> Le 17/06/2016 02:37, Paul Gortmaker a écrit :
> > The Kconfig currently controlling compilation of this code is:
> >
> > drivers/memory/Kconfig:config ATMEL_EBI
> > drivers/memory/Kconfig: bool "Atmel EBI driver"
> >
> > ...meaning that it currently is not being built as a module by
> > anyone.
> >
> > Lets remove the few remaining modular references, 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 also delete the MODULE_LICENSE tag etc. since all that
> > information is already contained at the top of the file in the
> > comments.
> >
> > Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> > Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > Cc: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
>
> We'll have to take the two atmel-related drivers through our git trees
> and arm-soc.
>
> Thanks Paul. Bye.
>
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> > drivers/memory/atmel-ebi.c | 9 ++-------
> > 1 file changed, 2 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
> > index 17d9d3f60f20..f87ad6f5d2dc 100644
> > --- a/drivers/memory/atmel-ebi.c
> > +++ b/drivers/memory/atmel-ebi.c
> > @@ -14,7 +14,7 @@
> > #include <linux/mfd/syscon.h>
> > #include <linux/mfd/syscon/atmel-matrix.h>
> > #include <linux/mfd/syscon/atmel-smc.h>
> > -#include <linux/module.h>
> > +#include <linux/init.h>
> > #include <linux/of_device.h>
> > #include <linux/regmap.h>
> >
> > @@ -648,7 +648,6 @@ static const struct of_device_id
> > at91_ebi_id_table[] = { },
> > { /* sentinel */ }
> > };
> > -MODULE_DEVICE_TABLE(of, at91_ebi_id_table);
> >
> > static int at91_ebi_dev_disable(struct at91_ebi *ebi, struct
> > device_node *np) {
> > @@ -764,8 +763,4 @@ static struct platform_driver at91_ebi_driver =
> > { .of_match_table = at91_ebi_id_table,
> > },
> > };
> > -module_platform_driver_probe(at91_ebi_driver, at91_ebi_probe);
> > -
> > -MODULE_AUTHOR("Jean-Jacques Hiblot <jjhiblot@traphandler.com>");
> > -MODULE_DESCRIPTION("Atmel EBI driver");
> > -MODULE_LICENSE("GPL");
> > +builtin_platform_driver_probe(at91_ebi_driver, at91_ebi_probe);
> >
>
>
[toc] | [prev] | [next] | [standalone]
| From | Alexandre Belloni <alexandre.belloni@free-electrons.com> |
|---|---|
| Date | 2016-06-21 17:30 +0200 |
| Subject | Re: [PATCH 6/6] memory: atmel-ebi: make it explicitly non-modular |
| Message-ID | <rMvMK-7AG-13@gated-at.bofh.it> |
| In reply to | #1424564 |
On 16/06/2016 at 20:37:48 -0400, Paul Gortmaker wrote : > The Kconfig currently controlling compilation of this code is: > > drivers/memory/Kconfig:config ATMEL_EBI > drivers/memory/Kconfig: bool "Atmel EBI driver" > > ...meaning that it currently is not being built as a module by anyone. > > Lets remove the few remaining modular references, 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 also delete the MODULE_LICENSE tag etc. since all that information > is already contained at the top of the file in the comments. > > Cc: Boris Brezillon <boris.brezillon@free-electrons.com> > Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> > Cc: Jean-Jacques Hiblot <jjhiblot@traphandler.com> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> > --- > drivers/memory/atmel-ebi.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > Applied, thanks. -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
[toc] | [prev] | [next] | [standalone]
| From | Paul Gortmaker <paul.gortmaker@windriver.com> |
|---|---|
| Date | 2016-06-17 02:50 +0200 |
| Subject | [PATCH 2/6] memory: mvebu-devbus: make it explicitly non-modular |
| Message-ID | <rKQ8V-7Ix-23@gated-at.bofh.it> |
| In reply to | #1424563 |
The Kconfig for this option is currently:
config MVEBU_DEVBUS
bool "Marvell EBU Device Bus Controller"
...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity, so that when reading the
driver there is no 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. An
alternate init level might be worth considering at a later date.
We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/memory/mvebu-devbus.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/memory/mvebu-devbus.c b/drivers/memory/mvebu-devbus.c
index 24852812fd44..543eeec47bd1 100644
--- a/drivers/memory/mvebu-devbus.c
+++ b/drivers/memory/mvebu-devbus.c
@@ -2,6 +2,8 @@
* Marvell EBU SoC Device Bus Controller
* (memory controller for NOR/NAND/SRAM/FPGA devices)
*
+ * Author: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
+ *
* Copyright (C) 2013-2014 Marvell
*
* This program is free software: you can redistribute it and/or modify
@@ -19,7 +21,7 @@
*/
#include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/io.h>
@@ -340,7 +342,6 @@ static const struct of_device_id mvebu_devbus_of_match[] = {
{ .compatible = "marvell,orion-devbus" },
{},
};
-MODULE_DEVICE_TABLE(of, mvebu_devbus_of_match);
static struct platform_driver mvebu_devbus_driver = {
.probe = mvebu_devbus_probe,
@@ -354,8 +355,4 @@ static int __init mvebu_devbus_init(void)
{
return platform_driver_register(&mvebu_devbus_driver);
}
-module_init(mvebu_devbus_init);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Ezequiel Garcia <ezequiel.garcia@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell EBU SoC Device Bus controller");
+device_initcall(mvebu_devbus_init);
--
2.8.4
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web