All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] mfd: trivial demodularization of non-modular drivers.
@ 2016-09-12 14:40 ` Paul Gortmaker
  0 siblings, 0 replies; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Boris BREZILLON, Florian Lobmaier,
	Laxman Dewangan, Lee Jones, Maxime Ripard, Mika Westerberg,
	Samuel Ortiz, Sourav Poddar, Thor Thayer, Tony Lindgren,
	linux-omap

I grouped this little series of mfd commits together because of the
common theme of their relatively trivial use of modular infrastructure
in these non-modular drivers.

What that means is there are no orphaned __exit functions to remove;
no unused ".remove" functions linked into the driver struct to be
deleted -- so in the end we have binary equivalence between the
pre-patched code and the post-patched code. Easy to review and low risk.

More specifically - the only thing we are doing here is mapping the
initcall that binds in the driver from the module variant to the
built-in variant ; something that CPP would do for us anyway -- and
then throwing away any MODULE_ tags which are no-ops in non-modular
builds (while preserving any author/desc. info they had in comments).
And in doing that, we can toss the include of module.h in favour of
init.h (asssuming it wasn't included already).

One exception is patch #2; it converts a driver from bool to tristate,
as was asked per the v1 review[1].  This has been build tested, but
I don't have the specific hardware for run time testing.

For anyone new to the underlying goal of this cleanup, we are trying to
make driver code consistent with the Makefiles/Kconfigs that control them.

This means not using modular functions/macros for drivers that can never
be built as a module.  Some of the other downfalls this leads to are:

 (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 drivers and spreads like weeds.

Build tested on linux-next for arm, arm64 and x86-64 to ensure no typos
or similar issues crept in.

[1] https://lkml.kernel.org/r/20160705012544.14143-1-paul.gortmaker@windriver.com

Paul.
---

[v1 --> v2: make one driver tristate, add some Ackd-by tags.]

Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
Cc: Florian Lobmaier <florian.lobmaier@ams.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Sourav Poddar <sourav.poddar@ti.com>
Cc: Thor Thayer <tthayer@opensource.altera.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org

Paul Gortmaker (6):
  mfd: altera-a10sr: make it explicitly non-modular
  mfd: as3722: convert MFD_AS3722 from bool to tristate
  mfd: intel_msic: Make it explicitly non-modular
  mfd: smsc-ece1099: Make it explicitly non-modular
  mfd: sun6i-prcm: Make it explicitly non-modular
  mfd: twl-core: Make it explicitly non-modular

 drivers/mfd/Kconfig        |  2 +-
 drivers/mfd/altera-a10sr.c | 14 ++++++--------
 drivers/mfd/intel_msic.c   |  9 ++-------
 drivers/mfd/smsc-ece1099.c | 11 ++---------
 drivers/mfd/sun6i-prcm.c   |  8 ++------
 drivers/mfd/twl-core.c     |  9 +--------
 6 files changed, 14 insertions(+), 39 deletions(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2 0/6] mfd: trivial demodularization of non-modular drivers.
@ 2016-09-12 14:40 ` Paul Gortmaker
  0 siblings, 0 replies; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Boris BREZILLON, Florian Lobmaier,
	Laxman Dewangan, Lee Jones, Maxime Ripard, Mika Westerberg,
	Samuel Ortiz, Sourav Poddar, Thor Thayer, Tony Lindgren,
	linux-omap

I grouped this little series of mfd commits together because of the
common theme of their relatively trivial use of modular infrastructure
in these non-modular drivers.

What that means is there are no orphaned __exit functions to remove;
no unused ".remove" functions linked into the driver struct to be
deleted -- so in the end we have binary equivalence between the
pre-patched code and the post-patched code. Easy to review and low risk.

More specifically - the only thing we are doing here is mapping the
initcall that binds in the driver from the module variant to the
built-in variant ; something that CPP would do for us anyway -- and
then throwing away any MODULE_ tags which are no-ops in non-modular
builds (while preserving any author/desc. info they had in comments).
And in doing that, we can toss the include of module.h in favour of
init.h (asssuming it wasn't included already).

One exception is patch #2; it converts a driver from bool to tristate,
as was asked per the v1 review[1].  This has been build tested, but
I don't have the specific hardware for run time testing.

For anyone new to the underlying goal of this cleanup, we are trying to
make driver code consistent with the Makefiles/Kconfigs that control them.

This means not using modular functions/macros for drivers that can never
be built as a module.  Some of the other downfalls this leads to are:

 (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 drivers and spreads like weeds.

Build tested on linux-next for arm, arm64 and x86-64 to ensure no typos
or similar issues crept in.

[1] https://lkml.kernel.org/r/20160705012544.14143-1-paul.gortmaker@windriver.com

Paul.
---

[v1 --> v2: make one driver tristate, add some Ackd-by tags.]

Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
Cc: Florian Lobmaier <florian.lobmaier@ams.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Sourav Poddar <sourav.poddar@ti.com>
Cc: Thor Thayer <tthayer@opensource.altera.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org

Paul Gortmaker (6):
  mfd: altera-a10sr: make it explicitly non-modular
  mfd: as3722: convert MFD_AS3722 from bool to tristate
  mfd: intel_msic: Make it explicitly non-modular
  mfd: smsc-ece1099: Make it explicitly non-modular
  mfd: sun6i-prcm: Make it explicitly non-modular
  mfd: twl-core: Make it explicitly non-modular

 drivers/mfd/Kconfig        |  2 +-
 drivers/mfd/altera-a10sr.c | 14 ++++++--------
 drivers/mfd/intel_msic.c   |  9 ++-------
 drivers/mfd/smsc-ece1099.c | 11 ++---------
 drivers/mfd/sun6i-prcm.c   |  8 ++------
 drivers/mfd/twl-core.c     |  9 +--------
 6 files changed, 14 insertions(+), 39 deletions(-)

-- 
2.8.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
  2016-09-12 14:40 ` Paul Gortmaker
  (?)
@ 2016-09-12 14:40 ` Paul Gortmaker
  2016-09-13  8:52   ` Lee Jones
  -1 siblings, 1 reply; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Thor Thayer, Lee Jones

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_ALTERA_A10SR
drivers/mfd/Kconfig:    bool "Altera Arria10 DevKit System Resource chip"

...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 builtin_driver() uses the same init level priority as
module_spi_driver() the init ordering remains unchanged with
this commit. [Note that there is no builtin_spi_driver macro,
so we open-code what it would be via builtin_driver().]

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
was (or is now) contained at the top of the file in the comments.

Cc: Thor Thayer <tthayer@opensource.altera.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/altera-a10sr.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c
index 40ed65e5fb2a..06e1f7fc5605 100644
--- a/drivers/mfd/altera-a10sr.c
+++ b/drivers/mfd/altera-a10sr.c
@@ -1,4 +1,8 @@
 /*
+ * Altera Arria10 DevKit System Resource MFD Driver
+ *
+ * Author: Thor Thayer <tthayer@opensource.altera.com>
+ *
  * Copyright Intel Corporation (C) 2014-2016. All Rights Reserved
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -20,7 +24,7 @@
 
 #include <linux/mfd/altera-a10sr.h>
 #include <linux/mfd/core.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/spi/spi.h>
 
@@ -152,7 +156,6 @@ static const struct of_device_id altr_a10sr_spi_of_match[] = {
 	{ .compatible = "altr,a10sr" },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match);
 
 static struct spi_driver altr_a10sr_spi_driver = {
 	.probe = altr_a10sr_spi_probe,
@@ -161,9 +164,4 @@ static struct spi_driver altr_a10sr_spi_driver = {
 		.of_match_table = of_match_ptr(altr_a10sr_spi_of_match),
 	},
 };
-
-module_spi_driver(altr_a10sr_spi_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Thor Thayer <tthayer@opensource.altera.com>");
-MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver");
+builtin_driver(altr_a10sr_spi_driver, spi_register_driver)
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/6] mfd: as3722: convert MFD_AS3722 from bool to tristate
  2016-09-12 14:40 ` Paul Gortmaker
  (?)
  (?)
@ 2016-09-12 14:40 ` Paul Gortmaker
  2016-09-13  8:52   ` Lee Jones
  -1 siblings, 1 reply; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Samuel Ortiz, Lee Jones, Florian Lobmaier,
	Laxman Dewangan

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AS3722
drivers/mfd/Kconfig:    bool "ams AS3722 Power Management IC"

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

In response to an earlier patch set suggesting removal of the unused
modular code, Laxman suggested that this driver be instead moved to
tristate.

We do that here, and confirm it can build and modpost as a tristate.
However there remains to be runtime testing in order to ensure this
change is 100% functional for "=m".

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Florian Lobmaier <florian.lobmaier@ams.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 9ac9f6250ba8..9a529bf06eed 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -50,7 +50,7 @@ config MFD_AS3711
 	  Support for the AS3711 PMIC from AMS
 
 config MFD_AS3722
-	bool "ams AS3722 Power Management IC"
+	tristate "ams AS3722 Power Management IC"
 	select MFD_CORE
 	select REGMAP_I2C
 	select REGMAP_IRQ
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
  2016-09-12 14:40 ` Paul Gortmaker
                   ` (2 preceding siblings ...)
  (?)
@ 2016-09-12 14:40 ` Paul Gortmaker
  2016-09-13  8:52   ` Lee Jones
  -1 siblings, 1 reply; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Lee Jones, Mika Westerberg

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_INTEL_MSIC
drivers/mfd/Kconfig:    bool "Intel MSIC

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

Lets remove the couple instances of module 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.

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: Lee Jones <lee.jones@linaro.org>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/intel_msic.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c
index 25d486c543cb..2017446c5b4b 100644
--- a/drivers/mfd/intel_msic.c
+++ b/drivers/mfd/intel_msic.c
@@ -12,7 +12,7 @@
 #include <linux/err.h>
 #include <linux/gpio.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/intel_msic.h>
 #include <linux/platform_device.h>
@@ -449,9 +449,4 @@ static struct platform_driver intel_msic_driver = {
 		.name	= "intel_msic",
 	},
 };
-
-module_platform_driver(intel_msic_driver);
-
-MODULE_DESCRIPTION("Driver for Intel MSIC");
-MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(intel_msic_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 4/6] mfd: smsc-ece1099: Make it explicitly non-modular
  2016-09-12 14:40 ` Paul Gortmaker
                   ` (3 preceding siblings ...)
  (?)
@ 2016-09-12 14:40 ` Paul Gortmaker
  2016-09-13  8:52   ` Lee Jones
  -1 siblings, 1 reply; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Samuel Ortiz, Lee Jones, Sourav Poddar

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_SMSC
drivers/mfd/Kconfig:       bool "SMSC ECE1099 series chips"

...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_init was not in use by this code, the init ordering
remains unchanged with this commit.

We replace module.h with init.h and delete an unused moduleparam.h
include.

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: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/smsc-ece1099.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c
index cd18c09827ef..1f40baf1234e 100644
--- a/drivers/mfd/smsc-ece1099.c
+++ b/drivers/mfd/smsc-ece1099.c
@@ -11,8 +11,7 @@
  *
  */
 
-#include <linux/module.h>
-#include <linux/moduleparam.h>
+#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
 #include <linux/gpio.h>
@@ -81,7 +80,6 @@ static const struct i2c_device_id smsc_i2c_id[] = {
 	{ "smscece1099", 0},
 	{},
 };
-MODULE_DEVICE_TABLE(i2c, smsc_i2c_id);
 
 static struct i2c_driver smsc_i2c_driver = {
 	.driver = {
@@ -90,9 +88,4 @@ static struct i2c_driver smsc_i2c_driver = {
 	.probe = smsc_i2c_probe,
 	.id_table = smsc_i2c_id,
 };
-
-module_i2c_driver(smsc_i2c_driver);
-
-MODULE_AUTHOR("Sourav Poddar <sourav.poddar@ti.com>");
-MODULE_DESCRIPTION("SMSC chip multi-function driver");
-MODULE_LICENSE("GPL v2");
+builtin_i2c_driver(smsc_i2c_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 5/6] mfd: sun6i-prcm: Make it explicitly non-modular
  2016-09-12 14:40 ` Paul Gortmaker
                   ` (4 preceding siblings ...)
  (?)
@ 2016-09-12 14:40 ` Paul Gortmaker
  2016-09-12 17:43   ` Boris Brezillon
  2016-09-13  8:53   ` Lee Jones
  -1 siblings, 2 replies; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Samuel Ortiz, Lee Jones, Maxime Ripard, Boris BREZILLON

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_SUN6I_PRCM
drivers/mfd/Kconfig:    bool "Allwinner A31 PRCM 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_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

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: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/sun6i-prcm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
index 191173166d65..011fcc555945 100644
--- a/drivers/mfd/sun6i-prcm.c
+++ b/drivers/mfd/sun6i-prcm.c
@@ -9,7 +9,7 @@
  */
 
 #include <linux/mfd/core.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 
 struct prcm_data {
@@ -170,8 +170,4 @@ static struct platform_driver sun6i_prcm_driver = {
 	},
 	.probe = sun6i_prcm_probe,
 };
-module_platform_driver(sun6i_prcm_driver);
-
-MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>");
-MODULE_DESCRIPTION("Allwinner sun6i PRCM driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(sun6i_prcm_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 6/6] mfd: twl-core: Make it explicitly non-modular
  2016-09-12 14:40 ` Paul Gortmaker
@ 2016-09-12 14:40   ` Paul Gortmaker
  -1 siblings, 0 replies; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Tony Lindgren, Samuel Ortiz, Lee Jones, linux-omap

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config TWL4030_CORE
drivers/mfd/Kconfig:    bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support"

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

Lets remove what modular code that we can, so that when reading the
driver there is less doubt that it is builtin-only.  Note that we can't
remove the twl_remove() itself ; it is still used by the probe unwind
routine.  So we leave it linked into the .remove as well, even though
it will most likely never be called via that path from an unbind.

Since module_i2c_driver() uses the same init level priority as
builtin_i2c_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: Tony Lindgren <tony@atomide.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/twl-core.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index a49d3db6d936..c64615dca2bd 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -30,7 +30,6 @@
 
 #include <linux/init.h>
 #include <linux/mutex.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/clk.h>
@@ -1258,7 +1257,6 @@ static const struct i2c_device_id twl_ids[] = {
 	{ "twl6032", TWL6030_CLASS | TWL6032_SUBCLASS }, /* "Phoenix lite" */
 	{ /* end of list */ },
 };
-MODULE_DEVICE_TABLE(i2c, twl_ids);
 
 /* One Client Driver , 4 Clients */
 static struct i2c_driver twl_driver = {
@@ -1267,9 +1265,4 @@ static struct i2c_driver twl_driver = {
 	.probe		= twl_probe,
 	.remove		= twl_remove,
 };
-
-module_i2c_driver(twl_driver);
-
-MODULE_AUTHOR("Texas Instruments, Inc.");
-MODULE_DESCRIPTION("I2C Core interface for TWL");
-MODULE_LICENSE("GPL");
+builtin_i2c_driver(twl_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 6/6] mfd: twl-core: Make it explicitly non-modular
@ 2016-09-12 14:40   ` Paul Gortmaker
  0 siblings, 0 replies; 17+ messages in thread
From: Paul Gortmaker @ 2016-09-12 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Tony Lindgren, Samuel Ortiz, Lee Jones, linux-omap

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config TWL4030_CORE
drivers/mfd/Kconfig:    bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support"

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

Lets remove what modular code that we can, so that when reading the
driver there is less doubt that it is builtin-only.  Note that we can't
remove the twl_remove() itself ; it is still used by the probe unwind
routine.  So we leave it linked into the .remove as well, even though
it will most likely never be called via that path from an unbind.

Since module_i2c_driver() uses the same init level priority as
builtin_i2c_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: Tony Lindgren <tony@atomide.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/twl-core.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index a49d3db6d936..c64615dca2bd 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -30,7 +30,6 @@
 
 #include <linux/init.h>
 #include <linux/mutex.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/clk.h>
@@ -1258,7 +1257,6 @@ static const struct i2c_device_id twl_ids[] = {
 	{ "twl6032", TWL6030_CLASS | TWL6032_SUBCLASS }, /* "Phoenix lite" */
 	{ /* end of list */ },
 };
-MODULE_DEVICE_TABLE(i2c, twl_ids);
 
 /* One Client Driver , 4 Clients */
 static struct i2c_driver twl_driver = {
@@ -1267,9 +1265,4 @@ static struct i2c_driver twl_driver = {
 	.probe		= twl_probe,
 	.remove		= twl_remove,
 };
-
-module_i2c_driver(twl_driver);
-
-MODULE_AUTHOR("Texas Instruments, Inc.");
-MODULE_DESCRIPTION("I2C Core interface for TWL");
-MODULE_LICENSE("GPL");
+builtin_i2c_driver(twl_driver);
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/6] mfd: sun6i-prcm: Make it explicitly non-modular
  2016-09-12 14:40 ` [PATCH 5/6] mfd: sun6i-prcm: " Paul Gortmaker
@ 2016-09-12 17:43   ` Boris Brezillon
  2016-09-13  8:53   ` Lee Jones
  1 sibling, 0 replies; 17+ messages in thread
From: Boris Brezillon @ 2016-09-12 17:43 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Samuel Ortiz, Lee Jones, Maxime Ripard

On Mon, 12 Sep 2016 10:40:53 -0400
Paul Gortmaker <paul.gortmaker@windriver.com> wrote:

> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_SUN6I_PRCM
> drivers/mfd/Kconfig:    bool "Allwinner A31 PRCM 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_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> 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: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/mfd/sun6i-prcm.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
> index 191173166d65..011fcc555945 100644
> --- a/drivers/mfd/sun6i-prcm.c
> +++ b/drivers/mfd/sun6i-prcm.c
> @@ -9,7 +9,7 @@
>   */
>  
>  #include <linux/mfd/core.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/of.h>
>  
>  struct prcm_data {
> @@ -170,8 +170,4 @@ static struct platform_driver sun6i_prcm_driver = {
>  	},
>  	.probe = sun6i_prcm_probe,
>  };
> -module_platform_driver(sun6i_prcm_driver);
> -
> -MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>");
> -MODULE_DESCRIPTION("Allwinner sun6i PRCM driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun6i_prcm_driver);

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 6/6] mfd: twl-core: Make it explicitly non-modular
  2016-09-12 14:40   ` Paul Gortmaker
  (?)
@ 2016-09-13  3:26   ` Tony Lindgren
  -1 siblings, 0 replies; 17+ messages in thread
From: Tony Lindgren @ 2016-09-13  3:26 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Samuel Ortiz, Lee Jones, linux-omap

* Paul Gortmaker <paul.gortmaker@windriver.com> [160912 07:41]:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config TWL4030_CORE
> drivers/mfd/Kconfig:    bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove what modular code that we can, so that when reading the
> driver there is less doubt that it is builtin-only.  Note that we can't
> remove the twl_remove() itself ; it is still used by the probe unwind
> routine.  So we leave it linked into the .remove as well, even though
> it will most likely never be called via that path from an unbind.
> 
> Since module_i2c_driver() uses the same init level priority as
> builtin_i2c_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: Tony Lindgren <tony@atomide.com>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: linux-omap@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Yeah makes sense to me:

Acked-by: Tony Lindgren <tony@atomide.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
  2016-09-12 14:40 ` [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular Paul Gortmaker
@ 2016-09-13  8:52   ` Lee Jones
  0 siblings, 0 replies; 17+ messages in thread
From: Lee Jones @ 2016-09-13  8:52 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Thor Thayer

On Mon, 12 Sep 2016, Paul Gortmaker wrote:

> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_ALTERA_A10SR
> drivers/mfd/Kconfig:    bool "Altera Arria10 DevKit System Resource chip"
> 
> ...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 builtin_driver() uses the same init level priority as
> module_spi_driver() the init ordering remains unchanged with
> this commit. [Note that there is no builtin_spi_driver macro,
> so we open-code what it would be via builtin_driver().]
> 
> 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
> was (or is now) contained at the top of the file in the comments.
> 
> Cc: Thor Thayer <tthayer@opensource.altera.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/mfd/altera-a10sr.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c
> index 40ed65e5fb2a..06e1f7fc5605 100644
> --- a/drivers/mfd/altera-a10sr.c
> +++ b/drivers/mfd/altera-a10sr.c
> @@ -1,4 +1,8 @@
>  /*
> + * Altera Arria10 DevKit System Resource MFD Driver
> + *
> + * Author: Thor Thayer <tthayer@opensource.altera.com>
> + *
>   * Copyright Intel Corporation (C) 2014-2016. All Rights Reserved
>   *
>   * This program is free software; you can redistribute it and/or modify it
> @@ -20,7 +24,7 @@
>  
>  #include <linux/mfd/altera-a10sr.h>
>  #include <linux/mfd/core.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/of.h>
>  #include <linux/spi/spi.h>
>  
> @@ -152,7 +156,6 @@ static const struct of_device_id altr_a10sr_spi_of_match[] = {
>  	{ .compatible = "altr,a10sr" },
>  	{ },
>  };
> -MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match);
>  
>  static struct spi_driver altr_a10sr_spi_driver = {
>  	.probe = altr_a10sr_spi_probe,
> @@ -161,9 +164,4 @@ static struct spi_driver altr_a10sr_spi_driver = {
>  		.of_match_table = of_match_ptr(altr_a10sr_spi_of_match),
>  	},
>  };
> -
> -module_spi_driver(altr_a10sr_spi_driver);
> -
> -MODULE_LICENSE("GPL v2");
> -MODULE_AUTHOR("Thor Thayer <tthayer@opensource.altera.com>");
> -MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver");
> +builtin_driver(altr_a10sr_spi_driver, spi_register_driver)

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/6] mfd: as3722: convert MFD_AS3722 from bool to tristate
  2016-09-12 14:40 ` [PATCH 2/6] mfd: as3722: convert MFD_AS3722 from bool to tristate Paul Gortmaker
@ 2016-09-13  8:52   ` Lee Jones
  0 siblings, 0 replies; 17+ messages in thread
From: Lee Jones @ 2016-09-13  8:52 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Samuel Ortiz, Florian Lobmaier, Laxman Dewangan

On Mon, 12 Sep 2016, Paul Gortmaker wrote:

> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_AS3722
> drivers/mfd/Kconfig:    bool "ams AS3722 Power Management IC"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> In response to an earlier patch set suggesting removal of the unused
> modular code, Laxman suggested that this driver be instead moved to
> tristate.
> 
> We do that here, and confirm it can build and modpost as a tristate.
> However there remains to be runtime testing in order to ensure this
> change is 100% functional for "=m".
> 
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Florian Lobmaier <florian.lobmaier@ams.com>
> Cc: Laxman Dewangan <ldewangan@nvidia.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/mfd/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 9ac9f6250ba8..9a529bf06eed 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -50,7 +50,7 @@ config MFD_AS3711
>  	  Support for the AS3711 PMIC from AMS
>  
>  config MFD_AS3722
> -	bool "ams AS3722 Power Management IC"
> +	tristate "ams AS3722 Power Management IC"
>  	select MFD_CORE
>  	select REGMAP_I2C
>  	select REGMAP_IRQ

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
  2016-09-12 14:40 ` [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular Paul Gortmaker
@ 2016-09-13  8:52   ` Lee Jones
  0 siblings, 0 replies; 17+ messages in thread
From: Lee Jones @ 2016-09-13  8:52 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Mika Westerberg

On Mon, 12 Sep 2016, Paul Gortmaker wrote:

> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_INTEL_MSIC
> drivers/mfd/Kconfig:    bool "Intel MSIC
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the couple instances of module 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.
> 
> 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: Lee Jones <lee.jones@linaro.org>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/mfd/intel_msic.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c
> index 25d486c543cb..2017446c5b4b 100644
> --- a/drivers/mfd/intel_msic.c
> +++ b/drivers/mfd/intel_msic.c
> @@ -12,7 +12,7 @@
>  #include <linux/err.h>
>  #include <linux/gpio.h>
>  #include <linux/io.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/mfd/core.h>
>  #include <linux/mfd/intel_msic.h>
>  #include <linux/platform_device.h>
> @@ -449,9 +449,4 @@ static struct platform_driver intel_msic_driver = {
>  		.name	= "intel_msic",
>  	},
>  };
> -
> -module_platform_driver(intel_msic_driver);
> -
> -MODULE_DESCRIPTION("Driver for Intel MSIC");
> -MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
> -MODULE_LICENSE("GPL");
> +builtin_platform_driver(intel_msic_driver);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 4/6] mfd: smsc-ece1099: Make it explicitly non-modular
  2016-09-12 14:40 ` [PATCH 4/6] mfd: smsc-ece1099: " Paul Gortmaker
@ 2016-09-13  8:52   ` Lee Jones
  0 siblings, 0 replies; 17+ messages in thread
From: Lee Jones @ 2016-09-13  8:52 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Samuel Ortiz, Sourav Poddar

On Mon, 12 Sep 2016, Paul Gortmaker wrote:

> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_SMSC
> drivers/mfd/Kconfig:       bool "SMSC ECE1099 series chips"
> 
> ...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_init was not in use by this code, the init ordering
> remains unchanged with this commit.
> 
> We replace module.h with init.h and delete an unused moduleparam.h
> include.
> 
> 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: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Sourav Poddar <sourav.poddar@ti.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/mfd/smsc-ece1099.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c
> index cd18c09827ef..1f40baf1234e 100644
> --- a/drivers/mfd/smsc-ece1099.c
> +++ b/drivers/mfd/smsc-ece1099.c
> @@ -11,8 +11,7 @@
>   *
>   */
>  
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> +#include <linux/init.h>
>  #include <linux/slab.h>
>  #include <linux/i2c.h>
>  #include <linux/gpio.h>
> @@ -81,7 +80,6 @@ static const struct i2c_device_id smsc_i2c_id[] = {
>  	{ "smscece1099", 0},
>  	{},
>  };
> -MODULE_DEVICE_TABLE(i2c, smsc_i2c_id);
>  
>  static struct i2c_driver smsc_i2c_driver = {
>  	.driver = {
> @@ -90,9 +88,4 @@ static struct i2c_driver smsc_i2c_driver = {
>  	.probe = smsc_i2c_probe,
>  	.id_table = smsc_i2c_id,
>  };
> -
> -module_i2c_driver(smsc_i2c_driver);
> -
> -MODULE_AUTHOR("Sourav Poddar <sourav.poddar@ti.com>");
> -MODULE_DESCRIPTION("SMSC chip multi-function driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_i2c_driver(smsc_i2c_driver);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/6] mfd: sun6i-prcm: Make it explicitly non-modular
  2016-09-12 14:40 ` [PATCH 5/6] mfd: sun6i-prcm: " Paul Gortmaker
  2016-09-12 17:43   ` Boris Brezillon
@ 2016-09-13  8:53   ` Lee Jones
  1 sibling, 0 replies; 17+ messages in thread
From: Lee Jones @ 2016-09-13  8:53 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Samuel Ortiz, Maxime Ripard, Boris BREZILLON

On Mon, 12 Sep 2016, Paul Gortmaker wrote:

> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_SUN6I_PRCM
> drivers/mfd/Kconfig:    bool "Allwinner A31 PRCM 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_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> 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: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/mfd/sun6i-prcm.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
> index 191173166d65..011fcc555945 100644
> --- a/drivers/mfd/sun6i-prcm.c
> +++ b/drivers/mfd/sun6i-prcm.c
> @@ -9,7 +9,7 @@
>   */
>  
>  #include <linux/mfd/core.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/of.h>
>  
>  struct prcm_data {
> @@ -170,8 +170,4 @@ static struct platform_driver sun6i_prcm_driver = {
>  	},
>  	.probe = sun6i_prcm_probe,
>  };
> -module_platform_driver(sun6i_prcm_driver);
> -
> -MODULE_AUTHOR("Boris BREZILLON <boris.brezillon@free-electrons.com>");
> -MODULE_DESCRIPTION("Allwinner sun6i PRCM driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(sun6i_prcm_driver);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 6/6] mfd: twl-core: Make it explicitly non-modular
  2016-09-12 14:40   ` Paul Gortmaker
  (?)
  (?)
@ 2016-09-13  8:53   ` Lee Jones
  -1 siblings, 0 replies; 17+ messages in thread
From: Lee Jones @ 2016-09-13  8:53 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Tony Lindgren, Samuel Ortiz, linux-omap

On Mon, 12 Sep 2016, Paul Gortmaker wrote:

> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config TWL4030_CORE
> drivers/mfd/Kconfig:    bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove what modular code that we can, so that when reading the
> driver there is less doubt that it is builtin-only.  Note that we can't
> remove the twl_remove() itself ; it is still used by the probe unwind
> routine.  So we leave it linked into the .remove as well, even though
> it will most likely never be called via that path from an unbind.
> 
> Since module_i2c_driver() uses the same init level priority as
> builtin_i2c_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: Tony Lindgren <tony@atomide.com>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: linux-omap@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/mfd/twl-core.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> index a49d3db6d936..c64615dca2bd 100644
> --- a/drivers/mfd/twl-core.c
> +++ b/drivers/mfd/twl-core.c
> @@ -30,7 +30,6 @@
>  
>  #include <linux/init.h>
>  #include <linux/mutex.h>
> -#include <linux/module.h>
>  #include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/clk.h>
> @@ -1258,7 +1257,6 @@ static const struct i2c_device_id twl_ids[] = {
>  	{ "twl6032", TWL6030_CLASS | TWL6032_SUBCLASS }, /* "Phoenix lite" */
>  	{ /* end of list */ },
>  };
> -MODULE_DEVICE_TABLE(i2c, twl_ids);
>  
>  /* One Client Driver , 4 Clients */
>  static struct i2c_driver twl_driver = {
> @@ -1267,9 +1265,4 @@ static struct i2c_driver twl_driver = {
>  	.probe		= twl_probe,
>  	.remove		= twl_remove,
>  };
> -
> -module_i2c_driver(twl_driver);
> -
> -MODULE_AUTHOR("Texas Instruments, Inc.");
> -MODULE_DESCRIPTION("I2C Core interface for TWL");
> -MODULE_LICENSE("GPL");
> +builtin_i2c_driver(twl_driver);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-09-13  8:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 14:40 [PATCH v2 0/6] mfd: trivial demodularization of non-modular drivers Paul Gortmaker
2016-09-12 14:40 ` Paul Gortmaker
2016-09-12 14:40 ` [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular Paul Gortmaker
2016-09-13  8:52   ` Lee Jones
2016-09-12 14:40 ` [PATCH 2/6] mfd: as3722: convert MFD_AS3722 from bool to tristate Paul Gortmaker
2016-09-13  8:52   ` Lee Jones
2016-09-12 14:40 ` [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular Paul Gortmaker
2016-09-13  8:52   ` Lee Jones
2016-09-12 14:40 ` [PATCH 4/6] mfd: smsc-ece1099: " Paul Gortmaker
2016-09-13  8:52   ` Lee Jones
2016-09-12 14:40 ` [PATCH 5/6] mfd: sun6i-prcm: " Paul Gortmaker
2016-09-12 17:43   ` Boris Brezillon
2016-09-13  8:53   ` Lee Jones
2016-09-12 14:40 ` [PATCH 6/6] mfd: twl-core: " Paul Gortmaker
2016-09-12 14:40   ` Paul Gortmaker
2016-09-13  3:26   ` Tony Lindgren
2016-09-13  8:53   ` Lee Jones

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.