mfd: trivial demodularization of non-modular drivers.
cover mfd: trivial demodularization of non-modular drivers.
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 as we approach the end of the development window. Seems like a good choice for sending at this point in time.
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).
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.
As usual, we can consider making some of these tristate if an author has strong feelings about extending support into the modular realm, but I won't be able to run-time test any of that. And since I can't even know if a modular use case makes sense, I won't extend the functionality into the modular realm by default for anything.
Build tested on linux-next for arm, arm64 and x86-64 to ensure no typos or similar issues crept in.
Paul.
---
Paul Gortmaker (6):
mfd: altera-a10sr: make it explicitly non-modular
mfd: as3722: Make it explicitly non-modular
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/altera-a10sr.c | 14 ++++++-------- drivers/mfd/as3722.c | 12 ++---------- 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, 15 insertions(+), 48 deletions(-)
Signature · 1 line
2.8.4
PATCH 6/6 mfd: twl-core: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:
drivers/mfd/Kconfig:config TWL4030_COREdrivers/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.
--- drivers/mfd/twl-core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/mfd/twl-core.c +1 -8
@@ -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);
Signature · 1 line
2.8.4
PATCH 1/6 mfd: altera-a10sr: make it explicitly non-modular
In reply to Paul GortmakerThe Kconfig currently controlling compilation of this code is:
drivers/mfd/Kconfig:config MFD_ALTERA_A10SRdrivers/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.
--- drivers/mfd/altera-a10sr.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/mfd/altera-a10sr.c +6 -8
@@ -1,4 +1,8 @@/* +* Altera Arria10 DevKit System Resource MFD Driver +* +* Author: Thor Thayer <[email protected]> +* * 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 <[email protected]>" ); -MODULE_DESCRIPTION ("Altera Arria10 DevKit System Resource MFD Driver" ); +builtin_driver (altr_a10sr_spi_driver, spi_register_driver)
Signature · 1 line
2.8.4
PATCH 4/6 mfd: smsc-ece1099: Make it explicitly non-modular
In reply to Paul GortmakerThe Kconfig currently controlling compilation of this code is:
drivers/mfd/Kconfig:config MFD_SMSCdrivers/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.
--- drivers/mfd/smsc-ece1099.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/mfd/smsc-ece1099.c +2 -9
@@ -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 <[email protected]>" ); -MODULE_DESCRIPTION ("SMSC chip multi-function driver" ); -MODULE_LICENSE ("GPL v2" ); +builtin_i2c_driver (smsc_i2c_driver);
Signature · 1 line
2.8.4
PATCH 2/6 mfd: as3722: Make it explicitly non-modular
In reply to Paul GortmakerThe Kconfig currently controlling compilation of this code is:
drivers/mfd/Kconfig:config MFD_AS3722drivers/mfd/Kconfig: bool "ams AS3722 Power Management IC"
...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_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.
--- drivers/mfd/as3722.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/mfd/as3722.c +2 -10
@@ -27,7 +27,7 @@#include <linux/interrupt.h> #include <linux/irq.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/mfd/core.h> #include <linux/mfd/as3722.h> #include <linux/of.h>
@@ -439,13 +439,11 @@ static const struct of_device_id as3722_of_match[] = { { .compatible = "ams,as3722", }, {}, }; -MODULE_DEVICE_TABLE (of, as3722_of_match);static const struct i2c_device_id as3722_i2c_id[] = { {"as3722" ,0 }, {}, }; -MODULE_DEVICE_TABLE (i2c, as3722_i2c_id);static const struct dev_pm_ops as3722_pm_ops = {SET_SYSTEM_SLEEP_PM_OPS (as3722_i2c_suspend, as3722_i2c_resume)
@@ -460,10 +458,4 @@ static struct i2c_driver as3722_i2c_driver = { .probe = as3722_i2c_probe, .id_table = as3722_i2c_id, }; - -module_i2c_driver (as3722_i2c_driver); - -MODULE_DESCRIPTION ("I2C support for AS3722 PMICs" ); -MODULE_AUTHOR ("Florian Lobmaier <[email protected]>" ); -MODULE_AUTHOR ("Laxman Dewangan <[email protected]>" ); -MODULE_LICENSE ("GPL" ); +builtin_i2c_driver (as3722_i2c_driver);
Signature · 1 line
2.8.4
PATCH 5/6 mfd: sun6i-prcm: Make it explicitly non-modular
In reply to Paul GortmakerThe Kconfig currently controlling compilation of this code is:
drivers/mfd/Kconfig:config MFD_SUN6I_PRCMdrivers/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.
--- drivers/mfd/sun6i-prcm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/mfd/sun6i-prcm.c +2 -6
@@ -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 <[email protected]>" ); -MODULE_DESCRIPTION ("Allwinner sun6i PRCM driver" ); -MODULE_LICENSE ("GPL v2" ); +builtin_platform_driver (sun6i_prcm_driver);
Signature · 1 line
2.8.4
PATCH 3/6 mfd: intel_msic: Make it explicitly non-modular
In reply to Paul GortmakerThe Kconfig currently controlling compilation of this code is:
drivers/mfd/Kconfig:config MFD_INTEL_MSICdrivers/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.
--- drivers/mfd/intel_msic.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/mfd/intel_msic.c +2 -7
@@ -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 <[email protected]>" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (intel_msic_driver);
Signature · 1 line
2.8.4
Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 5 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_AS3722drivers/mfd/Kconfig: bool "ams AS3722 Power Management IC"
Should we convert this to as "tristate" so that it can be built as module also.
Re: [PATCH 5/6] mfd: sun6i-prcm: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 14 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_SUN6I_PRCMdrivers/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 asbuiltin_platform_driver()the init ordering remains unchanged with this commit.
Quoted 8 lines
We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.Cc Samuel Ortiz <[email protected]>Cc Lee Jones <[email protected]>Cc Maxime Ripard <[email protected]>Cc Boris BREZILLON <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Thanks,
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Re: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 4 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_INTEL_MSICdrivers/mfd/Kconfig: bool "Intel MSIC"
I would prefer if it could be turned to tristate instead. I don't see any reasons why it should only be builtin.
Re: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
Quoted 8 lines · [Re: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular] On…
Quoted 4 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_INTEL_MSICdrivers/mfd/Kconfig: bool "Intel MSIC"I would prefer if it could be turned to tristate instead. I don't see any reasons why it should only be builtin.
If I change it to tristate, it is still impossible to choose =m for it unless I revert your earlier commit forcing it to be built in.
commit 15a713df4145ad2540f8d84c3f4de930806f6151
Author: Mika Westerberg <[email protected]> Date: Thu Jan 26 17:35:05 2012 +0000
x86/config: Select MSIC MFD driver on Intel Medfield platform
On Intel Medfield platform we use MSIC MFD driver to create necessary platform devices so it is essential to have the driver compiled into the kernel.
If I revert that, then it is possible to choose =m and it compiles. (haven't completed modpost yet.. so may be missing symbols...)
Paul.
--
Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular
In reply to Laxman DewanganQuoted 11 lines · [Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular] On 05/07/2016…
Quoted 5 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_AS3722drivers/mfd/Kconfig: bool "ams AS3722 Power Management IC"Should we convert this to as "tristate" so that it can be built as module also.
Seems to compile and modpost w/o missing symbols as tristate:
paul@yow-builder:~/git/linux-head$ ls -l ../arm-build/drivers/mfd/as3722* -rw-rw-r-- 1 paul paul 13010 Jul 6 12:30 ../arm-build/drivers/mfd/as3722.ko -rw-rw-r-- 1 paul paul 1937 Jul 6 12:28 ../arm-build/drivers/mfd/as3722.mod.c -rw-rw-r-- 1 paul paul 3820 Jul 6 12:29 ../arm-build/drivers/mfd/as3722.mod.o -rw-rw-r-- 1 paul paul 11292 Jul 6 12:13 ../arm-build/drivers/mfd/as3722.o paul@yow-builder:~/git/linux-head$
...so I'll drop this patch in favour of the one line tristate conversion in v2.
Paul.
--
Re: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 18 lines · Paul Gortmaker
Quoted 8 lines · [Re: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular] On…
Quoted 4 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_INTEL_MSICdrivers/mfd/Kconfig: bool "Intel MSIC"I would prefer if it could be turned to tristate instead. I don't see any reasons why it should only be builtin.
If I change it to tristate, it is still impossible to choose =m for it unless I revert your earlier commit forcing it to be built in.
commit
15a713df4145ad2540f8d84c3f4de930806f6151Author: Mika Westerberg <[email protected]> Date: Thu Jan 26 17:35:05 2012 +0000
Quoted 8 lines
x86/config: Select MSIC MFD driver on Intel Medfield platform
On Intel Medfield platform we use MSIC MFD driver to create necessary platform devices so it is essential to have the driver compiled into the kernel.
If I revert that, then it is possible to choose =m and it compiles. (haven't completed modpost yet.. so may be missing symbols...)
I think we can revert that and make it modular. Adding Andy just in case I'm missing something obvious.
Re: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
Quoted 28 lines · Mika Westerberg
Quoted 27 lines · Paul Gortmaker
[Re: [PATCH 3/6] mfd:
intel_msic: Make it explicitly non-modular] OnQuoted 9 lines · 05/07/2016 (Tue 13:08) Mika Westerberg wrote:
Quoted 4 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_INTEL_MSIC
drivers/mfd/Kconfig: bool "Intel MSIC"I would prefer if it could be turned to tristate instead. I don't see
any reasons why it should only be builtin.If I change it to tristate, it is still impossible to choose =m for it
unless I revert your earlier commit forcing it to be built in.commit
15a713df4145ad2540f8d84c3f4de930806f6151
Author: Mika Westerberg <[email protected]> Date: Thu Jan 26 17:35:05 2012 +0000x86/config: Select MSIC MFD driver on Intel Medfield platform
On Intel Medfield platform we use MSIC MFD driver to create necessary platform devices so it is essential to have the driver compiled into the kernel.
Quoted 6 lines
Quoted 2 lines
If I revert that, then it is possible to choose =m and it compiles. (haven't completed modpost yet.. so may be missing symbols...)
I think we can revert that and make it modular. Adding Andy just in case
I'm missing something obvious.
I doubt we may do this. The MID platforms MSIC used for some voltage regulations and other stuff, moreover it exports an API which might be used by the code which can be (for now) only compiled in. I wouldn't take a headache to convert users and check all possible Kconfig variations (check this gpio-msic.c).
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Mika Westerberg
Acked-byRe: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
Quoted 36 lines · Andy Shevchenko
Quoted 28 lines · Mika Westerberg
Quoted 27 lines · Paul Gortmaker
[Re: [PATCH 3/6] mfd:
intel_msic: Make it explicitly non-modular] OnQuoted 9 lines · 05/07/2016 (Tue 13:08) Mika Westerberg wrote:
Quoted 4 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_INTEL_MSIC
drivers/mfd/Kconfig: bool "Intel MSIC"I would prefer if it could be turned to tristate instead. I don't see
any reasons why it should only be builtin.If I change it to tristate, it is still impossible to choose =m for it
unless I revert your earlier commit forcing it to be built in.commit
15a713df4145ad2540f8d84c3f4de930806f6151
Author: Mika Westerberg <[email protected]> Date: Thu Jan 26 17:35:05 2012 +0000x86/config: Select MSIC MFD driver on Intel Medfield platform
On Intel Medfield platform we use MSIC MFD driver to create necessary platform devices so it is essential to have the driver compiled into the kernel.Quoted 6 lines
Quoted 2 lines
If I revert that, then it is possible to choose =m and it compiles. (haven't completed modpost yet.. so may be missing symbols...)
I think we can revert that and make it modular. Adding Andy just in case
I'm missing something obvious.
Quoted 5 lines
I doubt we may do this. The MID platforms MSIC used for some voltage regulations and other stuff, moreover it exports an API which might be used by the code which can be (for now) only compiled in. I wouldn't take a headache to convert users and check all possible
Kconfigvariations (check thisgpio-msic.c).
OK, thanks Andy.
So I withdraw my comment about tristating the driver. Let's make it explictly non-modular then.
For the patch,
Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 23 lines · Paul Gortmaker
Quoted 11 lines · [Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular] On 05/07/2016…
Quoted 5 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_AS3722drivers/mfd/Kconfig: bool "ams AS3722 Power Management IC"Should we convert this to as "tristate" so that it can be built as module also.
Seems to compile and modpost w/o missing symbols as tristate:
paul@yow-builder:~/git/linux-head$ ls -l ../arm-build/drivers/mfd/as3722*(quoted diff) +0
-4-rw-rw-r-- 1 paul paul 13010 Jul 6 12:30 ../arm-build/drivers/mfd/as3722.ko -rw-rw-r-- 1 paul paul 1937 Jul 6 12:28 ../arm-build/drivers/mfd/as3722.mod.c -rw-rw-r-- 1 paul paul 3820 Jul 6 12:29 ../arm-build/drivers/mfd/as3722.mod.o -rw-rw-r-- 1 paul paul 11292 Jul 6 12:13 ../arm-build/drivers/mfd/as3722.opaul@yow-builder:~/git/linux-head$
Quoted 1 line
...so I'll drop this patch in favour of the one line tristate conversion in v2.
Did you ever get around to submitting a v2?
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedRe: [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
In reply to Paul GortmakerQuoted 20 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_ALTERA_A10SRdrivers/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 asmodule_spi_driver()the init ordering remains unchanged with this commit. [Note that there is nobuiltin_spi_drivermacro, so we open-code what it would be viabuiltin_driver().]Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information was (or is now) contained at the top of the file in the comments.
Quoted 6 lines
Cc Thor Thayer <[email protected]>Cc Lee Jones <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>--- drivers/mfd/altera-a10sr.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
Applied, thanks.
Quoted 41 lines
drivers/mfd/altera-a10sr.c +6
-8@@ -1,4 +1,8 @@/* +* Altera Arria10 DevKit System Resource MFD Driver +* +* Author: Thor Thayer <[email protected]> +* * 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 <[email protected]>" ); -MODULE_DESCRIPTION ("Altera Arria10 DevKit System Resource MFD Driver" ); +builtin_driver (altr_a10sr_spi_driver, spi_register_driver)
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedRe: [PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 17 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_INTEL_MSICdrivers/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 asbuiltin_platform_driver()the init ordering remains unchanged with this commit.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 6 lines
Cc Lee Jones <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>--- drivers/mfd/intel_msic.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
Applied, thanks.
Quoted 24 lines
drivers/mfd/intel_msic.c +2
-7@@ -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 <[email protected]>" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (intel_msic_driver);
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedRe: [PATCH 4/6] mfd: smsc-ece1099: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 21 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_SMSCdrivers/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_initwas not in use by this code, the init ordering remains unchanged with this commit.We replace
module.hwithinit.hand delete an unusedmoduleparam.hinclude.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 7 lines
Cc Samuel Ortiz <[email protected]>Cc Lee Jones <[email protected]>Cc Sourav Poddar <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>--- drivers/mfd/smsc-ece1099.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
Applied, thanks.
Quoted 33 lines
drivers/mfd/smsc-ece1099.c +2
-9@@ -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 <[email protected]>" ); -MODULE_DESCRIPTION ("SMSC chip multi-function driver" ); -MODULE_LICENSE ("GPL v2" ); +builtin_i2c_driver (smsc_i2c_driver);
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedRe: [PATCH 5/6] mfd: sun6i-prcm: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 17 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_SUN6I_PRCMdrivers/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 asbuiltin_platform_driver()the init ordering remains unchanged with this commit.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 8 lines
Cc Samuel Ortiz <[email protected]>Cc Lee Jones <[email protected]>Cc Maxime Ripard <[email protected]>Cc Boris BREZILLON <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>--- drivers/mfd/sun6i-prcm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
Applied, thanks.
Quoted 23 lines
drivers/mfd/sun6i-prcm.c +2
-6@@ -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 <[email protected]>" ); -MODULE_DESCRIPTION ("Allwinner sun6i PRCM driver" ); -MODULE_LICENSE ("GPL v2" ); +builtin_platform_driver (sun6i_prcm_driver);
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedRe: [PATCH 6/6] mfd: twl-core: Make it explicitly non-modular
In reply to Paul GortmakerQuoted 22 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
TWL4030_COREdrivers/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 asbuiltin_i2c_driver()the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 8 lines
Cc Tony Lindgren <[email protected]>Cc Samuel Ortiz <[email protected]>Cc Lee Jones <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>--- drivers/mfd/twl-core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
Applied, thanks.
Quoted 31 lines
drivers/mfd/twl-core.c +1
-8@@ -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);
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular
In reply to Lee JonesQuoted 25 lines · [Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular] On 05/08/2016…
Quoted 23 lines · Paul Gortmaker
Quoted 11 lines · [Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular] On 05/07/2016…
Quoted 5 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_AS3722drivers/mfd/Kconfig: bool "ams AS3722 Power Management IC"Should we convert this to as "tristate" so that it can be built as module also.
Seems to compile and modpost w/o missing symbols as tristate:
paul@yow-builder:~/git/linux-head$ ls -l ../arm-build/drivers/mfd/as3722*(quoted diff) +0
-4-rw-rw-r-- 1 paul paul 13010 Jul 6 12:30 ../arm-build/drivers/mfd/as3722.ko -rw-rw-r-- 1 paul paul 1937 Jul 6 12:28 ../arm-build/drivers/mfd/as3722.mod.c -rw-rw-r-- 1 paul paul 3820 Jul 6 12:29 ../arm-build/drivers/mfd/as3722.mod.o -rw-rw-r-- 1 paul paul 11292 Jul 6 12:13 ../arm-build/drivers/mfd/as3722.opaul@yow-builder:~/git/linux-head$
Quoted 3 lines
Quoted 1 line
...so I'll drop this patch in favour of the one line tristate conversion in v2.
Did you ever get around to submitting a v2?
I made the v2 (as per above build stats) but never sent it out since I wasn't sure if mfd wanted a complete resend (like davem/linux-net) or just resends of the revised content... and then I never came back to it.
Here is the one line trivial patch. If you want to punt this to 4.9 given the current timing wrt. the merge window, feel free to do so; and/or I can re-send it myself with other pending 4.9 content I have.
Thanks,
Paul.
--
From 97a056efc6404f612ab83ea900e1aae2cbcac4a6 Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <[email protected]>
Date: Tue, 8 Sep 2015 20:53:04 -0400
Subject: [PATCH] mfd: as3722: convert MFD_AS3722 from bool to tristate
The Kconfig currently controlling compilation of this code is:
drivers/mfd/Kconfig:config MFD_AS3722drivers/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".
--- drivers/mfd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/Kconfig +1 -1
@@ -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
Signature · 1 line
2.8.4
Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular
Quoted 35 lines · Paul Gortmaker
Quoted 25 lines · [Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular] On 05/08/2016…
Quoted 23 lines · Paul Gortmaker
Quoted 11 lines · [Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular] On 05/07/2016…
Quoted 5 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_AS3722drivers/mfd/Kconfig: bool "ams AS3722 Power Management IC"Should we convert this to as "tristate" so that it can be built as module also.
Seems to compile and modpost w/o missing symbols as tristate:
paul@yow-builder:~/git/linux-head$ ls -l ../arm-build/drivers/mfd/as3722*(quoted diff) +0
-4-rw-rw-r-- 1 paul paul 13010 Jul 6 12:30 ../arm-build/drivers/mfd/as3722.ko -rw-rw-r-- 1 paul paul 1937 Jul 6 12:28 ../arm-build/drivers/mfd/as3722.mod.c -rw-rw-r-- 1 paul paul 3820 Jul 6 12:29 ../arm-build/drivers/mfd/as3722.mod.o -rw-rw-r-- 1 paul paul 11292 Jul 6 12:13 ../arm-build/drivers/mfd/as3722.opaul@yow-builder:~/git/linux-head$
Quoted 3 lines
Quoted 1 line
...so I'll drop this patch in favour of the one line tristate conversion in v2.
Did you ever get around to submitting a v2?
I made the v2 (as per above build stats) but never sent it out since I wasn't sure if mfd wanted a complete resend (like davem/linux-net) or just resends of the revised content... and then I never came back to it.
Quoted 5 lines
Here is the one line trivial patch. If you want to punt this to 4.9 given the current timing wrt. the merge window, feel free to do so; and/or I can re-send it myself with other pending 4.9 content I have.
From a personal PoV, I'd prefer if you just submitted patches
normally. I'll field them when they land in my Inbox.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular
Quoted 1 line · [Re: [PATCH 2/6] mfd: as3722: Make it explicitly non-modular] On 08/08/2016…
On Fri, 05 Aug 2016, Paul Gortmaker wrote:
D>
[...]
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
...so I'll drop this patch in favour of the one line tristate conversion in v2.
Did you ever get around to submitting a v2?
I made the v2 (as per above build stats) but never sent it out since I wasn't sure if mfd wanted a complete resend (like davem/linux-net) or just resends of the revised content... and then I never came back to it.
Quoted 6 lines
Quoted 3 lines
Here is the one line trivial patch. If you want to punt this to 4.9 given the current timing wrt. the merge window, feel free to do so; and/or I can re-send it myself with other pending 4.9 content I have.
From a personal PoV, I'd prefer if you just submitted patches normally. I'll field them when they land in my Inbox.
Yep, understood. I just didn't want to lose the context of the above discussion wrt. this one-line patch.
Now that rc1 was done last night, pending mfd changes will be the normal 0/N followed by the patches; all sent via git send-email as usual.
Thanks,
Paul.
--
Quoted 6 lines
Signature · 5 lines
-- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
In reply to Lee JonesQuoted 12 lines · Lee Jones
Quoted 10 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_ALTERA_A10SRdrivers/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.
[...]
Quoted 9 lines
Quoted 7 lines
Cc Thor Thayer <[email protected]>Cc Lee Jones <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>--- drivers/mfd/altera-a10sr.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)Applied, thanks.
Hi Lee,
I never did see this applied copy of the patch loop around via linux-next and conflict with my local copy of the same patch. Same for 3,4,5,6 of the same series (patch #2 was not applied; it was dropped in favour of a redo as a tristate conversion.)
Just wanting to double check I didn't mess something up that caused them to get silently dropped after the fact, before I prepare to send any additional mfd patches to be considered for your 4.9 content queue.
Thanks,
Paul.
--
Quoted 48 lines
Quoted 32 lines
drivers/mfd/altera-a10sr.c +5
-2@@ -1,4 +1,8 @@/* +* Altera Arria10 DevKit System Resource MFD Driver +* +* Author: Thor Thayer <[email protected]> +* * 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,drivers/mfd/altera-a10sr.c static struct spi_driver altr_a10sr_spi_driver = { · line 167
Quoted 10 lines
drivers/mfd/altera-a10sr.c +1
-6@@ -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 <[email protected]>" ); -MODULE_DESCRIPTION ("Altera Arria10 DevKit System Resource MFD Driver" ); +builtin_driver (altr_a10sr_spi_driver, spi_register_driver)--
Lee Jones
Linaro STMicroelectronics Landing Team LeadLinaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
Quoted 28 lines · Paul Gortmaker
Quoted 12 lines · Lee Jones
Quoted 10 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/mfd/Kconfig:config
MFD_ALTERA_A10SRdrivers/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.
[...]
Quoted 9 lines
Quoted 7 lines
Cc Thor Thayer <[email protected]>Cc Lee Jones <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>--- drivers/mfd/altera-a10sr.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)Applied, thanks.
Hi Lee,
Quoted 8 lines
I never did see this applied copy of the patch loop around via linux-next and conflict with my local copy of the same patch. Same for 3,4,5,6 of the same series (patch #2 was not applied; it was dropped in favour of a redo as a tristate conversion.)
Just wanting to double check I didn't mess something up that caused them to get silently dropped after the fact, before I prepare to send any additional mfd patches to be considered for your 4.9 content queue.
It's been dropped. Make your subsequent changes.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog