linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] mfd: simple demodularization of non-modular drivers
@ 2018-11-22  4:32 Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 01/11] mfd: as3711: Make it explicitly non-modular Paul Gortmaker
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Gortmaker, Arnd Bergmann, Cory Maccarrone,
	Dong Aisheng, Graeme Gregory, Guennadi Liakhovetski,
	Haojian Zhuang, Jorge Eduardo Candelaria, Laxman Dewangan,
	Linus Walleij, Mattias Nilsson, Tony Lindgren, linux-omap,
	patches, Support Opensource

This group of MFD drivers are all controlled by "bool" Kconfig settings,
but contain traces of module infrastructure like unused/orphaned __exit
functions, use of <linux/module.h> and/or MODULE_ macros that are no-ops
in the non-modular case.

We can remove/replace all of the above.  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 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 quickly.

The changes here should represent zero runtime changes.  Only the ones
with removed __exit functions will have a slightly smaller object size.
The source gets a net reduction of 100+ lines of unused code.

Build testing was done on drivers/mfd for allyesconfig on x86_64, ARM
and ARM-64.

Paul.

---

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Cory Maccarrone <darkstar6262@gmail.com>
Cc: Dong Aisheng <dong.aisheng@linaro.org>
Cc: Graeme Gregory <gg@slimlogic.co.uk>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Cc: patches@opensource.cirrus.com
Cc: Support Opensource <support.opensource@diasemi.com>

Paul Gortmaker (11):
  mfd: as3711: Make it explicitly non-modular
  mfd: da9055-core: make it explicitly non-modular
  mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code
  mfd: htc-i2cpld: Make it explicitly non-modular
  mfd: max8925-core: drop unused MODULE_ tags from non-modular code
  mfd: rc5t583: Make it explicitly non-modular
  mfd: sta2x11: drop unused MODULE_ tags from non-modular code
  mfd: syscon: Make it explicitly non-modular
  mfd: tps65910: Make it explicitly non-modular
  mfd: wm831x-core: drop unused MODULE_ tags from non-modular code
  mfd: wm8400-core: Make it explicitly non-modular

 drivers/mfd/as3711.c       | 14 --------------
 drivers/mfd/da9055-core.c  | 13 ++-----------
 drivers/mfd/db8500-prcmu.c | 10 ++++------
 drivers/mfd/htc-i2cpld.c   | 18 +-----------------
 drivers/mfd/max8925-core.c |  7 +------
 drivers/mfd/rc5t583.c      | 14 --------------
 drivers/mfd/sta2x11-mfd.c  | 10 ++++------
 drivers/mfd/syscon.c       | 12 +-----------
 drivers/mfd/tps65910.c     | 18 +-----------------
 drivers/mfd/wm831x-core.c  |  7 ++-----
 drivers/mfd/wm8400-core.c  | 18 +++---------------
 11 files changed, 19 insertions(+), 122 deletions(-)

-- 
2.7.4

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

* [PATCH 01/11] mfd: as3711: Make it explicitly non-modular
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 02/11] mfd: da9055-core: make " Paul Gortmaker
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, Guennadi Liakhovetski

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AS3711
drivers/mfd/Kconfig:    bool "AMS AS3711"

...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 don't replace module.h with init.h since the file already has that.

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: Lee Jones <lee.jones@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/as3711.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index 67b12417585d..7a74a874b93c 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/mfd/as3711.h>
 #include <linux/mfd/core.h>
-#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
@@ -118,7 +117,6 @@ static const struct of_device_id as3711_of_match[] = {
 	{.compatible = "ams,as3711",},
 	{}
 };
-MODULE_DEVICE_TABLE(of, as3711_of_match);
 #endif
 
 static int as3711_i2c_probe(struct i2c_client *client,
@@ -202,8 +200,6 @@ static const struct i2c_device_id as3711_i2c_id[] = {
 	{}
 };
 
-MODULE_DEVICE_TABLE(i2c, as3711_i2c_id);
-
 static struct i2c_driver as3711_i2c_driver = {
 	.driver = {
 		   .name = "as3711",
@@ -219,13 +215,3 @@ static int __init as3711_i2c_init(void)
 }
 /* Initialise early */
 subsys_initcall(as3711_i2c_init);
-
-static void __exit as3711_i2c_exit(void)
-{
-	i2c_del_driver(&as3711_i2c_driver);
-}
-module_exit(as3711_i2c_exit);
-
-MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
-MODULE_DESCRIPTION("AS3711 PMIC driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4


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

* [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 01/11] mfd: as3711: Make it explicitly non-modular Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
       [not found]   ` <201811231036.wIjm7GBh%fengguang.wu@intel.com>
  2018-11-22  4:32 ` [PATCH 03/11] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code Paul Gortmaker
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, Support Opensource

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_DA9055
drivers/mfd/Kconfig:    bool "Dialog Semiconductor DA9055 PMIC 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 exit function deleted here wasn't even registered with module_exit,
so it truly was dead 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.

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols

Cc: Support Opensource <support.opensource@diasemi.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/da9055-core.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/mfd/da9055-core.c b/drivers/mfd/da9055-core.c
index 177e65a12c12..b55f13061547 100644
--- a/drivers/mfd/da9055-core.c
+++ b/drivers/mfd/da9055-core.c
@@ -11,7 +11,8 @@
  *  option) any later version.
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/device.h>
 #include <linux/input.h>
 #include <linux/irq.h>
@@ -416,13 +417,3 @@ int da9055_device_init(struct da9055 *da9055)
 	mfd_remove_devices(da9055->dev);
 	return ret;
 }
-
-void da9055_device_exit(struct da9055 *da9055)
-{
-	regmap_del_irq_chip(da9055->chip_irq, da9055->irq_data);
-	mfd_remove_devices(da9055->dev);
-}
-
-MODULE_DESCRIPTION("Core support for the DA9055 PMIC");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
-- 
2.7.4


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

* [PATCH 03/11] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 01/11] mfd: as3711: Make it explicitly non-modular Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 02/11] mfd: da9055-core: make " Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-30 22:19   ` Linus Walleij
  2018-11-22  4:32 ` [PATCH 04/11] mfd: htc-i2cpld: Make it explicitly non-modular Paul Gortmaker
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, Linus Walleij, Mattias Nilsson

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_DB8500_PRCMU
drivers/mfd/Kconfig:    bool "ST-Ericsson DB8500 Power Reset Control Management Unit"

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

Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/db8500-prcmu.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index aec20e1c7d3d..65666b624ae8 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -1,4 +1,6 @@
 /*
+ * DB8500 PRCM Unit driver
+ *
  * Copyright (C) STMicroelectronics 2009
  * Copyright (C) ST-Ericsson SA 2010
  *
@@ -10,7 +12,8 @@
  * U8500 PRCM Unit interface driver
  *
  */
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
@@ -3188,9 +3191,4 @@ static int __init db8500_prcmu_init(void)
 {
 	return platform_driver_register(&db8500_prcmu_driver);
 }
-
 core_initcall(db8500_prcmu_init);
-
-MODULE_AUTHOR("Mattias Nilsson <mattias.i.nilsson@stericsson.com>");
-MODULE_DESCRIPTION("DB8500 PRCM Unit driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4


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

* [PATCH 04/11] mfd: htc-i2cpld: Make it explicitly non-modular
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
                   ` (2 preceding siblings ...)
  2018-11-22  4:32 ` [PATCH 03/11] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 05/11] mfd: max8925-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, Cory Maccarrone

The Kconfig for this option is currently:

config HTC_I2CPLD
        bool "HTC I2C PLD chip 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_init translates to device_initcall in the non-modular
case, 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: Cory Maccarrone <darkstar6262@gmail.com>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/htc-i2cpld.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index 01572b5e79e8..af3c66355270 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -27,7 +27,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
@@ -614,8 +613,6 @@ static const struct i2c_device_id htcpld_chip_id[] = {
 	{ "htcpld-chip", 0 },
 	{ }
 };
-MODULE_DEVICE_TABLE(i2c, htcpld_chip_id);
-
 
 static struct i2c_driver htcpld_chip_driver = {
 	.driver = {
@@ -643,17 +640,4 @@ static int __init htcpld_core_init(void)
 	/* Probe for our chips */
 	return platform_driver_probe(&htcpld_core_driver, htcpld_core_probe);
 }
-
-static void __exit htcpld_core_exit(void)
-{
-	i2c_del_driver(&htcpld_chip_driver);
-	platform_driver_unregister(&htcpld_core_driver);
-}
-
-module_init(htcpld_core_init);
-module_exit(htcpld_core_exit);
-
-MODULE_AUTHOR("Cory Maccarrone <darkstar6262@gmail.com>");
-MODULE_DESCRIPTION("I2C HTC PLD Driver");
-MODULE_LICENSE("GPL");
-
+device_initcall(htcpld_core_init);
-- 
2.7.4


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

* [PATCH 05/11] mfd: max8925-core: drop unused MODULE_ tags from non-modular code
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
                   ` (3 preceding siblings ...)
  2018-11-22  4:32 ` [PATCH 04/11] mfd: htc-i2cpld: Make it explicitly non-modular Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 06/11] mfd: rc5t583: Make it explicitly non-modular Paul Gortmaker
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, Haojian Zhuang

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX8925
drivers/mfd/Kconfig:    bool "Maxim Semiconductor MAX8925 PMIC Support"

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

Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

We 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: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/max8925-core.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mfd/max8925-core.c b/drivers/mfd/max8925-core.c
index fd8b15cd84fd..87c724ba9793 100644
--- a/drivers/mfd/max8925-core.c
+++ b/drivers/mfd/max8925-core.c
@@ -10,7 +10,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -919,8 +919,3 @@ void max8925_device_exit(struct max8925_chip *chip)
 		free_irq(chip->tsc_irq, chip);
 	mfd_remove_devices(chip->dev);
 }
-
-
-MODULE_DESCRIPTION("PMIC Driver for Maxim MAX8925");
-MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com");
-MODULE_LICENSE("GPL");
-- 
2.7.4


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

* [PATCH 06/11] mfd: rc5t583: Make it explicitly non-modular
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
                   ` (4 preceding siblings ...)
  2018-11-22  4:32 ` [PATCH 05/11] mfd: max8925-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 07/11] mfd: sta2x11: drop unused MODULE_ tags from non-modular code Paul Gortmaker
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, Laxman Dewangan

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_RC5T583
drivers/mfd/Kconfig:    bool "Ricoh RC5T583 Power Management system device"

...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.

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: Lee Jones <lee.jones@linaro.org>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/rc5t583.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index fd46de02b715..c5cc5cb3dde7 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -23,7 +23,6 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/err.h>
 #include <linux/slab.h>
@@ -298,8 +297,6 @@ static const struct i2c_device_id rc5t583_i2c_id[] = {
 	{}
 };
 
-MODULE_DEVICE_TABLE(i2c, rc5t583_i2c_id);
-
 static struct i2c_driver rc5t583_i2c_driver = {
 	.driver = {
 		   .name = "rc5t583",
@@ -313,14 +310,3 @@ static int __init rc5t583_i2c_init(void)
 	return i2c_add_driver(&rc5t583_i2c_driver);
 }
 subsys_initcall(rc5t583_i2c_init);
-
-static void __exit rc5t583_i2c_exit(void)
-{
-	i2c_del_driver(&rc5t583_i2c_driver);
-}
-
-module_exit(rc5t583_i2c_exit);
-
-MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
-MODULE_DESCRIPTION("RICOH RC5T583 power management system device driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4


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

* [PATCH 07/11] mfd: sta2x11: drop unused MODULE_ tags from non-modular code
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
                   ` (5 preceding siblings ...)
  2018-11-22  4:32 ` [PATCH 06/11] mfd: rc5t583: Make it explicitly non-modular Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 08/11] mfd: syscon: Make it explicitly non-modular Paul Gortmaker
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_STA2X11
drivers/mfd/Kconfig:    bool "STMicroelectronics STA2X11"

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

Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

We delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

We replace module.h with init.h and export.h ; the latter since the
file does export some symbols.

Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/sta2x11-mfd.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index 3aeafa228baf..cab9aabcaa1f 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -1,4 +1,6 @@
 /*
+ * STA2x11 mfd for GPIO, SCTL and APBREG
+ *
  * Copyright (c) 2009-2011 Wind River Systems, Inc.
  * Copyright (c) 2011 ST Microelectronics (Alessandro Rubini, Davide Ciminaghi)
  *
@@ -18,7 +20,8 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/device.h>
@@ -653,8 +656,3 @@ static int __init sta2x11_mfd_init(void)
  */
 subsys_initcall(sta2x11_drivers_init);
 rootfs_initcall(sta2x11_mfd_init);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Wind River");
-MODULE_DESCRIPTION("STA2x11 mfd for GPIO, SCTL and APBREG");
-MODULE_DEVICE_TABLE(pci, sta2x11_mfd_tbl);
-- 
2.7.4


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

* [PATCH 08/11] mfd: syscon: Make it explicitly non-modular
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
                   ` (6 preceding siblings ...)
  2018-11-22  4:32 ` [PATCH 07/11] mfd: sta2x11: drop unused MODULE_ tags from non-modular code Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 09/11] mfd: tps65910: " Paul Gortmaker
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, Arnd Bergmann, Dong Aisheng

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_SYSCON
drivers/mfd/Kconfig:    bool "System Controller Register R/W Based on Regmap"

...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 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: Arnd Bergmann <arnd@arndb.de>
Cc: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/syscon.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b6d05cd934e6..0ecdffb3d967 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -15,7 +15,7 @@
 #include <linux/err.h>
 #include <linux/hwspinlock.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/list.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -272,13 +272,3 @@ static int __init syscon_init(void)
 	return platform_driver_register(&syscon_driver);
 }
 postcore_initcall(syscon_init);
-
-static void __exit syscon_exit(void)
-{
-	platform_driver_unregister(&syscon_driver);
-}
-module_exit(syscon_exit);
-
-MODULE_AUTHOR("Dong Aisheng <dong.aisheng@linaro.org>");
-MODULE_DESCRIPTION("System Control driver");
-MODULE_LICENSE("GPL v2");
-- 
2.7.4


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

* [PATCH 09/11] mfd: tps65910: Make it explicitly non-modular
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
                   ` (7 preceding siblings ...)
  2018-11-22  4:32 ` [PATCH 08/11] mfd: syscon: Make it explicitly non-modular Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  8:56   ` Graeme Gregory
  2018-11-22  4:32 ` [PATCH 10/11] mfd: wm831x-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
  2018-11-22  4:32 ` [PATCH 11/11] mfd: wm8400-core: Make it explicitly non-modular Paul Gortmaker
  10 siblings, 1 reply; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Paul Gortmaker, Tony Lindgren, Graeme Gregory,
	Jorge Eduardo Candelaria, linux-omap

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_TPS65910
drivers/mfd/Kconfig-    bool "TI TPS65910 Power Management 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 module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.
We do delete an unused moduleparam.h include though.

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: Tony Lindgren <tony@atomide.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Graeme Gregory <gg@slimlogic.co.uk>
Cc: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/tps65910.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index bf16cbe6fd88..aa3d472a10ff 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -1,5 +1,5 @@
 /*
- * tps65910.c  --  TI TPS6591x
+ * tps65910.c  --  TI TPS6591x chip family multi-function driver
  *
  * Copyright 2010 Texas Instruments Inc.
  *
@@ -13,8 +13,6 @@
  *
  */
 
-#include <linux/module.h>
-#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/err.h>
 #include <linux/slab.h>
@@ -374,7 +372,6 @@ static const struct of_device_id tps65910_of_match[] = {
 	{ .compatible = "ti,tps65911", .data = (void *)TPS65911},
 	{ },
 };
-MODULE_DEVICE_TABLE(of, tps65910_of_match);
 
 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 						unsigned long *chip_id)
@@ -527,8 +524,6 @@ static const struct i2c_device_id tps65910_i2c_id[] = {
        { "tps65911", TPS65911 },
        { }
 };
-MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
-
 
 static struct i2c_driver tps65910_i2c_driver = {
 	.driver = {
@@ -545,14 +540,3 @@ static int __init tps65910_i2c_init(void)
 }
 /* init early so consumer devices can complete system boot */
 subsys_initcall(tps65910_i2c_init);
-
-static void __exit tps65910_i2c_exit(void)
-{
-	i2c_del_driver(&tps65910_i2c_driver);
-}
-module_exit(tps65910_i2c_exit);
-
-MODULE_AUTHOR("Graeme Gregory <gg@slimlogic.co.uk>");
-MODULE_AUTHOR("Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>");
-MODULE_DESCRIPTION("TPS6591x chip family multi-function driver");
-MODULE_LICENSE("GPL");
-- 
2.7.4


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

* [PATCH 10/11] mfd: wm831x-core: drop unused MODULE_ tags from non-modular code
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
                   ` (8 preceding siblings ...)
  2018-11-22  4:32 ` [PATCH 09/11] mfd: tps65910: " Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  9:28   ` Charles Keepax
  2018-11-22  4:32 ` [PATCH 11/11] mfd: wm8400-core: Make it explicitly non-modular Paul Gortmaker
  10 siblings, 1 reply; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, patches

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X
drivers/mfd/Kconfig:    bool

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

Lets remove the couple traces of modular infrastructure use, so that
when reading the driver there is no doubt it is builtin-only.

We 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: patches@opensource.cirrus.com
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/wm831x-core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index e70d35ef5c6d..d64214c78cba 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -13,7 +13,8 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <linux/bcd.h>
 #include <linux/delay.h>
 #include <linux/mfd/core.h>
@@ -1944,7 +1945,3 @@ void wm831x_device_shutdown(struct wm831x *wm831x)
 	}
 }
 EXPORT_SYMBOL_GPL(wm831x_device_shutdown);
-
-MODULE_DESCRIPTION("Core support for the WM831X AudioPlus PMIC");
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown");
-- 
2.7.4


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

* [PATCH 11/11] mfd: wm8400-core: Make it explicitly non-modular
  2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
                   ` (9 preceding siblings ...)
  2018-11-22  4:32 ` [PATCH 10/11] mfd: wm831x-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
@ 2018-11-22  4:32 ` Paul Gortmaker
  2018-11-22  9:29   ` Charles Keepax
  10 siblings, 1 reply; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-22  4:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Paul Gortmaker, patches

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM8400
drivers/mfd/Kconfig:    bool "Wolfson Microelectronics WM8400"

...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.

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.

Finally a function is renamed to remove word "module" in order to
possibly remove any confusion.

Cc: Lee Jones <lee.jones@linaro.org>
Cc: patches@opensource.cirrus.com
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/mfd/wm8400-core.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 8a98a2fc74e1..79756c83f5f0 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -12,7 +12,7 @@
  *
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/bug.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
@@ -150,7 +150,6 @@ static const struct i2c_device_id wm8400_i2c_id[] = {
        { "wm8400", 0 },
        { }
 };
-MODULE_DEVICE_TABLE(i2c, wm8400_i2c_id);
 
 static struct i2c_driver wm8400_i2c_driver = {
 	.driver = {
@@ -161,7 +160,7 @@ static struct i2c_driver wm8400_i2c_driver = {
 };
 #endif
 
-static int __init wm8400_module_init(void)
+static int __init wm8400_driver_init(void)
 {
 	int ret = -ENODEV;
 
@@ -173,15 +172,4 @@ static int __init wm8400_module_init(void)
 
 	return ret;
 }
-subsys_initcall(wm8400_module_init);
-
-static void __exit wm8400_module_exit(void)
-{
-#if IS_ENABLED(CONFIG_I2C)
-	i2c_del_driver(&wm8400_i2c_driver);
-#endif
-}
-module_exit(wm8400_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
+subsys_initcall(wm8400_driver_init);
-- 
2.7.4


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

* Re: [PATCH 09/11] mfd: tps65910: Make it explicitly non-modular
  2018-11-22  4:32 ` [PATCH 09/11] mfd: tps65910: " Paul Gortmaker
@ 2018-11-22  8:56   ` Graeme Gregory
  0 siblings, 0 replies; 21+ messages in thread
From: Graeme Gregory @ 2018-11-22  8:56 UTC (permalink / raw)
  To: Paul Gortmaker, Lee Jones
  Cc: linux-kernel, Tony Lindgren, Jorge Eduardo Candelaria, linux-omap



On Thu, 22 Nov 2018, at 4:32 AM, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_TPS65910
> drivers/mfd/Kconfig-    bool "TI TPS65910 Power Management 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 module_init was not in use by this code, the init ordering
> remains unchanged with this commit.
> 
> We don't replace module.h with init.h since the file already has that.
> We do delete an unused moduleparam.h include though.
> 
> 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.
> 
This is all fine with me.

Acked-by: Graeme Gregory <gg@slimlogic.co.uk>

Thanks

> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Graeme Gregory <gg@slimlogic.co.uk>
> Cc: Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>
> Cc: linux-omap@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/mfd/tps65910.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> index bf16cbe6fd88..aa3d472a10ff 100644
> --- a/drivers/mfd/tps65910.c
> +++ b/drivers/mfd/tps65910.c
> @@ -1,5 +1,5 @@
>  /*
> - * tps65910.c  --  TI TPS6591x
> + * tps65910.c  --  TI TPS6591x chip family multi-function driver
>   *
>   * Copyright 2010 Texas Instruments Inc.
>   *
> @@ -13,8 +13,6 @@
>   *
>   */
>  
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
>  #include <linux/init.h>
>  #include <linux/err.h>
>  #include <linux/slab.h>
> @@ -374,7 +372,6 @@ static const struct of_device_id tps65910_of_match[] = {
>  	{ .compatible = "ti,tps65911", .data = (void *)TPS65911},
>  	{ },
>  };
> -MODULE_DEVICE_TABLE(of, tps65910_of_match);
>  
>  static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
>  						unsigned long *chip_id)
> @@ -527,8 +524,6 @@ static const struct i2c_device_id tps65910_i2c_id[] = {
>         { "tps65911", TPS65911 },
>         { }
>  };
> -MODULE_DEVICE_TABLE(i2c, tps65910_i2c_id);
> -
>  
>  static struct i2c_driver tps65910_i2c_driver = {
>  	.driver = {
> @@ -545,14 +540,3 @@ static int __init tps65910_i2c_init(void)
>  }
>  /* init early so consumer devices can complete system boot */
>  subsys_initcall(tps65910_i2c_init);
> -
> -static void __exit tps65910_i2c_exit(void)
> -{
> -	i2c_del_driver(&tps65910_i2c_driver);
> -}
> -module_exit(tps65910_i2c_exit);
> -
> -MODULE_AUTHOR("Graeme Gregory <gg@slimlogic.co.uk>");
> -MODULE_AUTHOR("Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>");
> -MODULE_DESCRIPTION("TPS6591x chip family multi-function driver");
> -MODULE_LICENSE("GPL");
> -- 
> 2.7.4
> 

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

* Re: [PATCH 10/11] mfd: wm831x-core: drop unused MODULE_ tags from non-modular code
  2018-11-22  4:32 ` [PATCH 10/11] mfd: wm831x-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
@ 2018-11-22  9:28   ` Charles Keepax
  0 siblings, 0 replies; 21+ messages in thread
From: Charles Keepax @ 2018-11-22  9:28 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: Lee Jones, linux-kernel, patches

On Wed, Nov 21, 2018 at 11:32:58PM -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_WM831X
> drivers/mfd/Kconfig:    bool
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the couple traces of modular infrastructure use, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> We 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: patches@opensource.cirrus.com
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH 11/11] mfd: wm8400-core: Make it explicitly non-modular
  2018-11-22  4:32 ` [PATCH 11/11] mfd: wm8400-core: Make it explicitly non-modular Paul Gortmaker
@ 2018-11-22  9:29   ` Charles Keepax
  0 siblings, 0 replies; 21+ messages in thread
From: Charles Keepax @ 2018-11-22  9:29 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: Lee Jones, linux-kernel, patches

On Wed, Nov 21, 2018 at 11:32:59PM -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/mfd/Kconfig:config MFD_WM8400
> drivers/mfd/Kconfig:    bool "Wolfson Microelectronics WM8400"
> 
> ...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.
> 
> 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.
> 
> Finally a function is renamed to remove word "module" in order to
> possibly remove any confusion.
> 
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: patches@opensource.cirrus.com
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular
       [not found]   ` <201811231036.wIjm7GBh%fengguang.wu@intel.com>
@ 2018-11-23  3:14     ` Paul Gortmaker
  2018-11-23 14:43       ` Paul Gortmaker
  0 siblings, 1 reply; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-23  3:14 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, Lee Jones, linux-kernel, Support Opensource

[Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular] On 23/11/2018 (Fri 10:21) kbuild test robot wrote:

> Hi Paul,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on ljones-mfd/for-mfd-next]
> [also build test ERROR on v4.20-rc3]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Paul-Gortmaker/mfd-simple-demodularization-of-non-modular-drivers/20181123-090206
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
> config: i386-randconfig-s1-11191736 (attached as .config)
> compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/mfd/da9055-i2c.o: In function `da9055_i2c_remove':
> >> drivers/mfd/da9055-i2c.c:53: undefined reference to `da9055_device_exit'

Thanks for the report -- I'll look into what causes it, why my testing
didn't see it, and get an update to Lee as soon as possible.

Paul.
--

> 
> vim +53 drivers/mfd/da9055-i2c.c
> 
> 2896434c Ashish Jangam  2012-09-14  48  
> 4740f73f Bill Pemberton 2012-11-19  49  static int da9055_i2c_remove(struct i2c_client *i2c)
> 2896434c Ashish Jangam  2012-09-14  50  {
> 2896434c Ashish Jangam  2012-09-14  51  	struct da9055 *da9055 = i2c_get_clientdata(i2c);
> 2896434c Ashish Jangam  2012-09-14  52  
> 2896434c Ashish Jangam  2012-09-14 @53  	da9055_device_exit(da9055);
> 2896434c Ashish Jangam  2012-09-14  54  
> 2896434c Ashish Jangam  2012-09-14  55  	return 0;
> 2896434c Ashish Jangam  2012-09-14  56  }
> 2896434c Ashish Jangam  2012-09-14  57  
> 
> :::::: The code at line 53 was first introduced by commit
> :::::: 2896434cf272acace1b7093d5e4ba8022ed11ac8 mfd: DA9055 core driver
> 
> :::::: TO: Ashish Jangam <ashish.jangam@kpitcummins.com>
> :::::: CC: Samuel Ortiz <sameo@linux.intel.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



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

* Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular
  2018-11-23  3:14     ` Paul Gortmaker
@ 2018-11-23 14:43       ` Paul Gortmaker
  2018-11-27 13:07         ` Lee Jones
  2018-11-28  9:35         ` Lee Jones
  0 siblings, 2 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-23 14:43 UTC (permalink / raw)
  To: kbuild test robot, Lee Jones
  Cc: kbuild-all, linux-kernel, David Dajun Chen, Support Opensource

[Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular] On 22/11/2018 (Thu 22:14) Paul Gortmaker wrote:

> [Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular] On 23/11/2018 (Fri 10:21) kbuild test robot wrote:
> 

[...]

> > 
> > All errors (new ones prefixed by >>):
> > 
> >    drivers/mfd/da9055-i2c.o: In function `da9055_i2c_remove':
> > >> drivers/mfd/da9055-i2c.c:53: undefined reference to `da9055_device_exit'
> 
> Thanks for the report -- I'll look into what causes it, why my testing
> didn't see it, and get an update to Lee as soon as possible.

OK, mystery solved.  I chose this smaller subset of MFD "simple" patches
from my pending queue of MFD patches - to create a reasonable sized
maintainer-friendly send, based on patches with zero runtime changes.

My other pending MFD patches have a trivial runtime behavior change;
deleting a ".remove" field/function - that will never be used for a
non-module case, but in theory could be (pointlessly) triggered by
forcing a driver unbind.  (see mainline 98b72b94def9 as an example)
Patches like this were left behind for a future send batch.

Unfortunately that allowed me to overlook the fact that patch #2 link
depended on the below ".remove" patch (not sent) to be applied 1st.

Lee, what would you like to have happen?  I can resend the queue with
this patch, or I can resend with #2 being temporarily deferred until
a future patch batch that has the below da9055-i2c in it, or ...

Whatever is easiest for you - let me know.

Paul.
--

From da28030dbcdcd5cb4807ad18dfa6fd4773719ad0 Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Sun, 6 Sep 2015 22:10:34 -0400
Subject: [PATCH] mfd: da9055-i2c: Make it explicitly non-modular

The Makefile/Kconfig currently controlling compilation of this code is:

drivers/mfd/Makefile:da9055-objs := da9055-core.o da9055-i2c.o
drivers/mfd/Makefile:obj-$(CONFIG_MFD_DA9055)   += da9055.o

...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.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init was not in use by this code, 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: Support Opensource <support.opensource@diasemi.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

diff --git a/drivers/mfd/da9055-i2c.c b/drivers/mfd/da9055-i2c.c
index b53e100f577c..7c66f82522f0 100644
--- a/drivers/mfd/da9055-i2c.c
+++ b/drivers/mfd/da9055-i2c.c
@@ -11,7 +11,7 @@
  *
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/device.h>
 #include <linux/i2c.h>
 #include <linux/err.h>
@@ -46,15 +46,6 @@ static int da9055_i2c_probe(struct i2c_client *i2c,
 	return da9055_device_init(da9055);
 }
 
-static int da9055_i2c_remove(struct i2c_client *i2c)
-{
-	struct da9055 *da9055 = i2c_get_clientdata(i2c);
-
-	da9055_device_exit(da9055);
-
-	return 0;
-}
-
 /*
  * DO NOT change the device Ids. The naming is intentionally specific as both
  * the PMIC and CODEC parts of this chip are instantiated separately as I2C
@@ -66,7 +57,6 @@ static struct i2c_device_id da9055_i2c_id[] = {
 	{"da9055-pmic", 0},
 	{ }
 };
-MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);
 
 static const struct of_device_id da9055_of_match[] = {
 	{ .compatible = "dlg,da9055-pmic", },
@@ -75,11 +65,11 @@ static const struct of_device_id da9055_of_match[] = {
 
 static struct i2c_driver da9055_i2c_driver = {
 	.probe = da9055_i2c_probe,
-	.remove = da9055_i2c_remove,
 	.id_table = da9055_i2c_id,
 	.driver = {
 		.name = "da9055-pmic",
 		.of_match_table = of_match_ptr(da9055_of_match),
+		.suppress_bind_attrs = true,
 	},
 };
 
@@ -96,13 +86,3 @@ static int __init da9055_i2c_init(void)
 	return 0;
 }
 subsys_initcall(da9055_i2c_init);
-
-static void __exit da9055_i2c_exit(void)
-{
-	i2c_del_driver(&da9055_i2c_driver);
-}
-module_exit(da9055_i2c_exit);
-
-MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
-MODULE_DESCRIPTION("I2C driver for Dialog DA9055 PMIC");
-MODULE_LICENSE("GPL");
-- 
2.8.0


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

* Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular
  2018-11-23 14:43       ` Paul Gortmaker
@ 2018-11-27 13:07         ` Lee Jones
  2018-11-27 15:03           ` Paul Gortmaker
  2018-11-28  9:35         ` Lee Jones
  1 sibling, 1 reply; 21+ messages in thread
From: Lee Jones @ 2018-11-27 13:07 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: kbuild test robot, kbuild-all, linux-kernel, David Dajun Chen,
	Support Opensource

On Fri, 23 Nov 2018, Paul Gortmaker wrote:

> [Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular] On 22/11/2018 (Thu 22:14) Paul Gortmaker wrote:
> 
> > [Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular] On 23/11/2018 (Fri 10:21) kbuild test robot wrote:
> > 
> 
> [...]
> 
> > > 
> > > All errors (new ones prefixed by >>):
> > > 
> > >    drivers/mfd/da9055-i2c.o: In function `da9055_i2c_remove':
> > > >> drivers/mfd/da9055-i2c.c:53: undefined reference to `da9055_device_exit'
> > 
> > Thanks for the report -- I'll look into what causes it, why my testing
> > didn't see it, and get an update to Lee as soon as possible.
> 
> OK, mystery solved.  I chose this smaller subset of MFD "simple" patches
> from my pending queue of MFD patches - to create a reasonable sized
> maintainer-friendly send, based on patches with zero runtime changes.
> 
> My other pending MFD patches have a trivial runtime behavior change;
> deleting a ".remove" field/function - that will never be used for a
> non-module case, but in theory could be (pointlessly) triggered by
> forcing a driver unbind.  (see mainline 98b72b94def9 as an example)
> Patches like this were left behind for a future send batch.

What about when .remove() is invoked during shutdown?

> Unfortunately that allowed me to overlook the fact that patch #2 link
> depended on the below ".remove" patch (not sent) to be applied 1st.
> 
> Lee, what would you like to have happen?  I can resend the queue with
> this patch, or I can resend with #2 being temporarily deferred until
> a future patch batch that has the below da9055-i2c in it, or ...
> 
> Whatever is easiest for you - let me know.
> 
> Paul.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular
  2018-11-27 13:07         ` Lee Jones
@ 2018-11-27 15:03           ` Paul Gortmaker
  0 siblings, 0 replies; 21+ messages in thread
From: Paul Gortmaker @ 2018-11-27 15:03 UTC (permalink / raw)
  To: Lee Jones
  Cc: kbuild test robot, kbuild-all, linux-kernel, David Dajun Chen,
	Support Opensource

[Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular] On 27/11/2018 (Tue 13:07) Lee Jones wrote:

> On Fri, 23 Nov 2018, Paul Gortmaker wrote:

[...]

> > My other pending MFD patches have a trivial runtime behavior change;
> > deleting a ".remove" field/function - that will never be used for a
> > non-module case, but in theory could be (pointlessly) triggered by
> > forcing a driver unbind.  (see mainline 98b72b94def9 as an example)
> > Patches like this were left behind for a future send batch.
> 
> What about when .remove() is invoked during shutdown?

It is my understanding that .remove is not invoked during shutdown.

If we step outside of MFD and look at mainline commit 7aa8619a66aea5
("iommu/arm-smmu-v3: Implement shutdown method") -- you can see it adds
a shutdown that is just a wrapper around the remove function.

If shutdown called remove, then this commit would cause the remove
function to get called *twice* on a shutdown.

I also don't see any obvious coupling in drivers/base/platform.c - they
seem independent, but it is possible I've overlooked something?

Thanks,
Paul.

----------
static int platform_drv_remove(struct device *_dev)
{
        struct platform_driver *drv = to_platform_driver(_dev->driver);
        struct platform_device *dev = to_platform_device(_dev);
        int ret = 0;

        if (drv->remove)
                ret = drv->remove(dev);
        dev_pm_domain_detach(_dev, true);

        return ret;
}

static void platform_drv_shutdown(struct device *_dev)
{
        struct platform_driver *drv = to_platform_driver(_dev->driver);
        struct platform_device *dev = to_platform_device(_dev);

        if (drv->shutdown)
                drv->shutdown(dev);
}
----------

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

* Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular
  2018-11-23 14:43       ` Paul Gortmaker
  2018-11-27 13:07         ` Lee Jones
@ 2018-11-28  9:35         ` Lee Jones
  1 sibling, 0 replies; 21+ messages in thread
From: Lee Jones @ 2018-11-28  9:35 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: kbuild test robot, kbuild-all, linux-kernel, David Dajun Chen,
	Support Opensource

On Fri, 23 Nov 2018, Paul Gortmaker wrote:

> [Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular] On 22/11/2018 (Thu 22:14) Paul Gortmaker wrote:
> 
> > [Re: [PATCH 02/11] mfd: da9055-core: make it explicitly non-modular] On 23/11/2018 (Fri 10:21) kbuild test robot wrote:
> > 
> 
> [...]
> 
> > > 
> > > All errors (new ones prefixed by >>):
> > > 
> > >    drivers/mfd/da9055-i2c.o: In function `da9055_i2c_remove':
> > > >> drivers/mfd/da9055-i2c.c:53: undefined reference to `da9055_device_exit'
> > 
> > Thanks for the report -- I'll look into what causes it, why my testing
> > didn't see it, and get an update to Lee as soon as possible.
> 
> OK, mystery solved.  I chose this smaller subset of MFD "simple" patches
> from my pending queue of MFD patches - to create a reasonable sized
> maintainer-friendly send, based on patches with zero runtime changes.
> 
> My other pending MFD patches have a trivial runtime behavior change;
> deleting a ".remove" field/function - that will never be used for a
> non-module case, but in theory could be (pointlessly) triggered by
> forcing a driver unbind.  (see mainline 98b72b94def9 as an example)
> Patches like this were left behind for a future send batch.
> 
> Unfortunately that allowed me to overlook the fact that patch #2 link
> depended on the below ".remove" patch (not sent) to be applied 1st.
> 
> Lee, what would you like to have happen?  I can resend the queue with
> this patch, or I can resend with #2 being temporarily deferred until
> a future patch batch that has the below da9055-i2c in it, or ...
> 
> Whatever is easiest for you - let me know.

Just send them all.

I'm going to have to review them all at one time or another.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 03/11] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code
  2018-11-22  4:32 ` [PATCH 03/11] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code Paul Gortmaker
@ 2018-11-30 22:19   ` Linus Walleij
  0 siblings, 0 replies; 21+ messages in thread
From: Linus Walleij @ 2018-11-30 22:19 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: Lee Jones, linux-kernel

On Thu, Nov 22, 2018 at 5:35 AM Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/mfd/Kconfig:config MFD_DB8500_PRCMU
> drivers/mfd/Kconfig:    bool "ST-Ericsson DB8500 Power Reset Control Management Unit"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the couple traces of modular infrastructure use, so that
> when reading the driver there is no doubt it is builtin-only.
>
> We delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> We replace module.h with init.h and export.h ; the latter since the
> file does export some symbols.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2018-11-30 22:19 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22  4:32 [PATCH 00/11] mfd: simple demodularization of non-modular drivers Paul Gortmaker
2018-11-22  4:32 ` [PATCH 01/11] mfd: as3711: Make it explicitly non-modular Paul Gortmaker
2018-11-22  4:32 ` [PATCH 02/11] mfd: da9055-core: make " Paul Gortmaker
     [not found]   ` <201811231036.wIjm7GBh%fengguang.wu@intel.com>
2018-11-23  3:14     ` Paul Gortmaker
2018-11-23 14:43       ` Paul Gortmaker
2018-11-27 13:07         ` Lee Jones
2018-11-27 15:03           ` Paul Gortmaker
2018-11-28  9:35         ` Lee Jones
2018-11-22  4:32 ` [PATCH 03/11] mfd: db8500-prcmu: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-11-30 22:19   ` Linus Walleij
2018-11-22  4:32 ` [PATCH 04/11] mfd: htc-i2cpld: Make it explicitly non-modular Paul Gortmaker
2018-11-22  4:32 ` [PATCH 05/11] mfd: max8925-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-11-22  4:32 ` [PATCH 06/11] mfd: rc5t583: Make it explicitly non-modular Paul Gortmaker
2018-11-22  4:32 ` [PATCH 07/11] mfd: sta2x11: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-11-22  4:32 ` [PATCH 08/11] mfd: syscon: Make it explicitly non-modular Paul Gortmaker
2018-11-22  4:32 ` [PATCH 09/11] mfd: tps65910: " Paul Gortmaker
2018-11-22  8:56   ` Graeme Gregory
2018-11-22  4:32 ` [PATCH 10/11] mfd: wm831x-core: drop unused MODULE_ tags from non-modular code Paul Gortmaker
2018-11-22  9:28   ` Charles Keepax
2018-11-22  4:32 ` [PATCH 11/11] mfd: wm8400-core: Make it explicitly non-modular Paul Gortmaker
2018-11-22  9:29   ` Charles Keepax

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).