[PATCH 1/8] gpio: palmas: fix implicit assumption module.h is present
This file is currently getting module.h from a global gpio header and it will fail to build once we remove module.h from that. However, the driver is controlled with the following Kconfig: drivers/gpio/Kconfig:config GPIO_PALMAS drivers/gpio/Kconfig: bool "TI PALMAS series PMICs GPIO" and hence the line of MODULE_DEVICE_TABLE is a no-op that can simply be deleted. In fact it should have been removed in an earlier commit that did demodularization, however the unseen include prevented my build testing from detecting it. Cc: Linus Walleij Cc: Alexandre Courbot Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/gpio/gpio-palmas.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c index 839474430229..3d818195e351 100644 --- a/drivers/gpio/gpio-palmas.c +++ b/drivers/gpio/gpio-palmas.c @@ -152,7 +152,6 @@ static const struct of_device_id of_palmas_gpio_match[] = { { .compatible = "ti,tps80036-gpio", .data = _dev_data,}, { }, }; -MODULE_DEVICE_TABLE(of, of_palmas_gpio_match); static int palmas_gpio_probe(struct platform_device *pdev) { -- 2.8.4
[PATCH 4/8] gpio: altera: fix implicit assumption module.h is present
The Kconfig for this file is: drivers/gpio/Kconfig:config GPIO_ALTERA drivers/gpio/Kconfig: tristate "Altera GPIO" ...but however it does not include module.h -- it in turn gets it from another header (gpio/driver.h) and we'd like to replace that with a forward delcaration of "struct module;" but if we do, this file will fail to compile. So we fix this first to avoid putting build failures into the bisect commit history. Cc: Linus Walleij <linus.wall...@linaro.org> Cc: Alexandre Courbot <gnu...@gmail.com> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/gpio/gpio-altera.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index 3f87a03abc22..5bddbd507ca9 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c @@ -17,6 +17,7 @@ */ #include +#include #include #include -- 2.8.4
[PATCH 4/8] gpio: altera: fix implicit assumption module.h is present
The Kconfig for this file is: drivers/gpio/Kconfig:config GPIO_ALTERA drivers/gpio/Kconfig: tristate "Altera GPIO" ...but however it does not include module.h -- it in turn gets it from another header (gpio/driver.h) and we'd like to replace that with a forward delcaration of "struct module;" but if we do, this file will fail to compile. So we fix this first to avoid putting build failures into the bisect commit history. Cc: Linus Walleij Cc: Alexandre Courbot Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/gpio/gpio-altera.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index 3f87a03abc22..5bddbd507ca9 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c @@ -17,6 +17,7 @@ */ #include +#include #include #include -- 2.8.4
[PATCH 4/6] mfd: smsc-ece1099: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_SMSC drivers/mfd/Kconfig: bool "SMSC ECE1099 series chips" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init was not in use by this code, the init ordering remains unchanged with this commit. We replace module.h with init.h and delete an unused moduleparam.h include. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Samuel Ortiz <sa...@linux.intel.com> Cc: Lee Jones <lee.jo...@linaro.org> Cc: Sourav Poddar <sourav.pod...@ti.com> Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/mfd/smsc-ece1099.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c index cd18c09827ef..1f40baf1234e 100644 --- a/drivers/mfd/smsc-ece1099.c +++ b/drivers/mfd/smsc-ece1099.c @@ -11,8 +11,7 @@ * */ -#include -#include +#include #include #include #include @@ -81,7 +80,6 @@ static const struct i2c_device_id smsc_i2c_id[] = { { "smscece1099", 0}, {}, }; -MODULE_DEVICE_TABLE(i2c, smsc_i2c_id); static struct i2c_driver smsc_i2c_driver = { .driver = { @@ -90,9 +88,4 @@ static struct i2c_driver smsc_i2c_driver = { .probe = smsc_i2c_probe, .id_table = smsc_i2c_id, }; - -module_i2c_driver(smsc_i2c_driver); - -MODULE_AUTHOR("Sourav Poddar <sourav.pod...@ti.com>"); -MODULE_DESCRIPTION("SMSC chip multi-function driver"); -MODULE_LICENSE("GPL v2"); +builtin_i2c_driver(smsc_i2c_driver); -- 2.8.4
[PATCH 4/6] mfd: smsc-ece1099: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_SMSC drivers/mfd/Kconfig: bool "SMSC ECE1099 series chips" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init was not in use by this code, the init ordering remains unchanged with this commit. We replace module.h with init.h and delete an unused moduleparam.h include. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Samuel Ortiz Cc: Lee Jones Cc: Sourav Poddar Signed-off-by: Paul Gortmaker --- drivers/mfd/smsc-ece1099.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c index cd18c09827ef..1f40baf1234e 100644 --- a/drivers/mfd/smsc-ece1099.c +++ b/drivers/mfd/smsc-ece1099.c @@ -11,8 +11,7 @@ * */ -#include -#include +#include #include #include #include @@ -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 "); -MODULE_DESCRIPTION("SMSC chip multi-function driver"); -MODULE_LICENSE("GPL v2"); +builtin_i2c_driver(smsc_i2c_driver); -- 2.8.4
[PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_ALTERA_A10SR drivers/mfd/Kconfig:bool "Altera Arria10 DevKit System Resource chip" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since builtin_driver() uses the same init level priority as module_spi_driver() the init ordering remains unchanged with this commit. [Note that there is no builtin_spi_driver macro, so we open-code what it would be via builtin_driver().] Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Cc: Thor Thayer <ttha...@opensource.altera.com> Cc: Lee Jones <lee.jo...@linaro.org> Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/mfd/altera-a10sr.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c index 40ed65e5fb2a..06e1f7fc5605 100644 --- a/drivers/mfd/altera-a10sr.c +++ b/drivers/mfd/altera-a10sr.c @@ -1,4 +1,8 @@ /* + * Altera Arria10 DevKit System Resource MFD Driver + * + * Author: Thor Thayer <ttha...@opensource.altera.com> + * * Copyright Intel Corporation (C) 2014-2016. All Rights Reserved * * This program is free software; you can redistribute it and/or modify it @@ -20,7 +24,7 @@ #include #include -#include +#include #include #include @@ -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 <ttha...@opensource.altera.com>"); -MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver"); +builtin_driver(altr_a10sr_spi_driver, spi_register_driver) -- 2.8.4
[PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_ALTERA_A10SR drivers/mfd/Kconfig:bool "Altera Arria10 DevKit System Resource chip" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since builtin_driver() uses the same init level priority as module_spi_driver() the init ordering remains unchanged with this commit. [Note that there is no builtin_spi_driver macro, so we open-code what it would be via builtin_driver().] Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Cc: Thor Thayer Cc: Lee Jones Signed-off-by: Paul Gortmaker --- drivers/mfd/altera-a10sr.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c index 40ed65e5fb2a..06e1f7fc5605 100644 --- a/drivers/mfd/altera-a10sr.c +++ b/drivers/mfd/altera-a10sr.c @@ -1,4 +1,8 @@ /* + * Altera Arria10 DevKit System Resource MFD Driver + * + * Author: Thor Thayer + * * 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 #include -#include +#include #include #include @@ -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 "); -MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver"); +builtin_driver(altr_a10sr_spi_driver, spi_register_driver) -- 2.8.4
[PATCH v2 0/6] 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. More specifically - the only thing we are doing here is mapping the initcall that binds in the driver from the module variant to the built-in variant ; something that CPP would do for us anyway -- and then throwing away any MODULE_ tags which are no-ops in non-modular builds (while preserving any author/desc. info they had in comments). And in doing that, we can toss the include of module.h in favour of init.h (asssuming it wasn't included already). One exception is patch #2; it converts a driver from bool to tristate, as was asked per the v1 review[1]. This has been build tested, but I don't have the specific hardware for run time testing. For anyone new to the underlying goal of this cleanup, we are trying to make driver code consistent with the Makefiles/Kconfigs that control them. This means not using modular functions/macros for drivers that can never be built as a module. Some of the other downfalls this leads to are: (1) it is easy to accidentally write unused module_exit and remove code (2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it (3) it requires the include of the module.h header file which in turn includes nearly everything else, thus adding to CPP overhead. (4) it gets copied/replicated into other drivers and spreads like weeds. Build tested on linux-next for arm, arm64 and x86-64 to ensure no typos or similar issues crept in. [1] https://lkml.kernel.org/r/20160705012544.14143-1-paul.gortma...@windriver.com Paul. --- [v1 --> v2: make one driver tristate, add some Ackd-by tags.] Cc: Boris BREZILLON <boris.brezil...@free-electrons.com> Cc: Florian Lobmaier <florian.lobma...@ams.com> Cc: Laxman Dewangan <ldewan...@nvidia.com> Cc: Lee Jones <lee.jo...@linaro.org> Cc: Maxime Ripard <maxime.rip...@free-electrons.com> Cc: Mika Westerberg <mika.westerb...@linux.intel.com> Cc: Samuel Ortiz <sa...@linux.intel.com> Cc: Sourav Poddar <sourav.pod...@ti.com> Cc: Thor Thayer <ttha...@opensource.altera.com> Cc: Tony Lindgren <t...@atomide.com> Cc: linux-o...@vger.kernel.org Paul Gortmaker (6): mfd: altera-a10sr: make it explicitly non-modular mfd: as3722: convert MFD_AS3722 from bool to tristate mfd: intel_msic: Make it explicitly non-modular mfd: smsc-ece1099: Make it explicitly non-modular mfd: sun6i-prcm: Make it explicitly non-modular mfd: twl-core: Make it explicitly non-modular drivers/mfd/Kconfig| 2 +- drivers/mfd/altera-a10sr.c | 14 ++ drivers/mfd/intel_msic.c | 9 ++--- drivers/mfd/smsc-ece1099.c | 11 ++- drivers/mfd/sun6i-prcm.c | 8 ++-- drivers/mfd/twl-core.c | 9 + 6 files changed, 14 insertions(+), 39 deletions(-) -- 2.8.4
[PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_INTEL_MSIC drivers/mfd/Kconfig:bool "Intel MSIC ...meaning that it currently is not being built as a module by anyone. Lets remove the couple instances of module references, so that when reading the driver there is no doubt it is builtin-only. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Lee Jones <lee.jo...@linaro.org> Cc: Mika Westerberg <mika.westerb...@linux.intel.com> Acked-by: Mika Westerberg <mika.westerb...@linux.intel.com> Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/mfd/intel_msic.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c index 25d486c543cb..2017446c5b4b 100644 --- a/drivers/mfd/intel_msic.c +++ b/drivers/mfd/intel_msic.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -449,9 +449,4 @@ static struct platform_driver intel_msic_driver = { .name = "intel_msic", }, }; - -module_platform_driver(intel_msic_driver); - -MODULE_DESCRIPTION("Driver for Intel MSIC"); -MODULE_AUTHOR("Mika Westerberg <mika.westerb...@linux.intel.com>"); -MODULE_LICENSE("GPL"); +builtin_platform_driver(intel_msic_driver); -- 2.8.4
[PATCH 2/6] mfd: as3722: convert MFD_AS3722 from bool to tristate
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_AS3722 drivers/mfd/Kconfig:bool "ams AS3722 Power Management IC" ...meaning that it currently is not being built as a module by anyone. In response to an earlier patch set suggesting removal of the unused modular code, Laxman suggested that this driver be instead moved to tristate. We do that here, and confirm it can build and modpost as a tristate. However there remains to be runtime testing in order to ensure this change is 100% functional for "=m". Cc: Samuel Ortiz <sa...@linux.intel.com> Cc: Lee Jones <lee.jo...@linaro.org> Cc: Florian Lobmaier <florian.lobma...@ams.com> Cc: Laxman Dewangan <ldewan...@nvidia.com> Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/mfd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 9ac9f6250ba8..9a529bf06eed 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -50,7 +50,7 @@ config MFD_AS3711 Support for the AS3711 PMIC from AMS config MFD_AS3722 - bool "ams AS3722 Power Management IC" + tristate "ams AS3722 Power Management IC" select MFD_CORE select REGMAP_I2C select REGMAP_IRQ -- 2.8.4
[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_CORE drivers/mfd/Kconfig:bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support" ...meaning that it currently is not being built as a module by anyone. Lets remove what modular code that we can, so that when reading the driver there is less doubt that it is builtin-only. Note that we can't remove the twl_remove() itself ; it is still used by the probe unwind routine. So we leave it linked into the .remove as well, even though it will most likely never be called via that path from an unbind. Since module_i2c_driver() uses the same init level priority as builtin_i2c_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Tony Lindgren <t...@atomide.com> Cc: Samuel Ortiz <sa...@linux.intel.com> Cc: Lee Jones <lee.jo...@linaro.org> Cc: linux-o...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/mfd/twl-core.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index a49d3db6d936..c64615dca2bd 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -1258,7 +1257,6 @@ static const struct i2c_device_id twl_ids[] = { { "twl6032", TWL6030_CLASS | TWL6032_SUBCLASS }, /* "Phoenix lite" */ { /* end of list */ }, }; -MODULE_DEVICE_TABLE(i2c, twl_ids); /* One Client Driver , 4 Clients */ static struct i2c_driver twl_driver = { @@ -1267,9 +1265,4 @@ static struct i2c_driver twl_driver = { .probe = twl_probe, .remove = twl_remove, }; - -module_i2c_driver(twl_driver); - -MODULE_AUTHOR("Texas Instruments, Inc."); -MODULE_DESCRIPTION("I2C Core interface for TWL"); -MODULE_LICENSE("GPL"); +builtin_i2c_driver(twl_driver); -- 2.8.4
[PATCH 5/6] mfd: sun6i-prcm: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_SUN6I_PRCM drivers/mfd/Kconfig:bool "Allwinner A31 PRCM controller" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple traces of modularity so that when reading the driver there is no doubt it is builtin-only. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Samuel Ortiz <sa...@linux.intel.com> Cc: Lee Jones <lee.jo...@linaro.org> Cc: Maxime Ripard <maxime.rip...@free-electrons.com> Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com> Cc: Boris BREZILLON <boris.brezil...@free-electrons.com> Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/mfd/sun6i-prcm.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c index 191173166d65..011fcc555945 100644 --- a/drivers/mfd/sun6i-prcm.c +++ b/drivers/mfd/sun6i-prcm.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include struct prcm_data { @@ -170,8 +170,4 @@ static struct platform_driver sun6i_prcm_driver = { }, .probe = sun6i_prcm_probe, }; -module_platform_driver(sun6i_prcm_driver); - -MODULE_AUTHOR("Boris BREZILLON <boris.brezil...@free-electrons.com>"); -MODULE_DESCRIPTION("Allwinner sun6i PRCM driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(sun6i_prcm_driver); -- 2.8.4
[PATCH v2 0/6] 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. More specifically - the only thing we are doing here is mapping the initcall that binds in the driver from the module variant to the built-in variant ; something that CPP would do for us anyway -- and then throwing away any MODULE_ tags which are no-ops in non-modular builds (while preserving any author/desc. info they had in comments). And in doing that, we can toss the include of module.h in favour of init.h (asssuming it wasn't included already). One exception is patch #2; it converts a driver from bool to tristate, as was asked per the v1 review[1]. This has been build tested, but I don't have the specific hardware for run time testing. For anyone new to the underlying goal of this cleanup, we are trying to make driver code consistent with the Makefiles/Kconfigs that control them. This means not using modular functions/macros for drivers that can never be built as a module. Some of the other downfalls this leads to are: (1) it is easy to accidentally write unused module_exit and remove code (2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it (3) it requires the include of the module.h header file which in turn includes nearly everything else, thus adding to CPP overhead. (4) it gets copied/replicated into other drivers and spreads like weeds. Build tested on linux-next for arm, arm64 and x86-64 to ensure no typos or similar issues crept in. [1] https://lkml.kernel.org/r/20160705012544.14143-1-paul.gortma...@windriver.com Paul. --- [v1 --> v2: make one driver tristate, add some Ackd-by tags.] Cc: Boris BREZILLON Cc: Florian Lobmaier Cc: Laxman Dewangan Cc: Lee Jones Cc: Maxime Ripard Cc: Mika Westerberg Cc: Samuel Ortiz Cc: Sourav Poddar Cc: Thor Thayer Cc: Tony Lindgren Cc: linux-o...@vger.kernel.org Paul Gortmaker (6): mfd: altera-a10sr: make it explicitly non-modular mfd: as3722: convert MFD_AS3722 from bool to tristate mfd: intel_msic: Make it explicitly non-modular mfd: smsc-ece1099: Make it explicitly non-modular mfd: sun6i-prcm: Make it explicitly non-modular mfd: twl-core: Make it explicitly non-modular drivers/mfd/Kconfig| 2 +- drivers/mfd/altera-a10sr.c | 14 ++ drivers/mfd/intel_msic.c | 9 ++--- drivers/mfd/smsc-ece1099.c | 11 ++- drivers/mfd/sun6i-prcm.c | 8 ++-- drivers/mfd/twl-core.c | 9 + 6 files changed, 14 insertions(+), 39 deletions(-) -- 2.8.4
[PATCH 3/6] mfd: intel_msic: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_INTEL_MSIC drivers/mfd/Kconfig:bool "Intel MSIC ...meaning that it currently is not being built as a module by anyone. Lets remove the couple instances of module references, so that when reading the driver there is no doubt it is builtin-only. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Lee Jones Cc: Mika Westerberg Acked-by: Mika Westerberg Signed-off-by: Paul Gortmaker --- drivers/mfd/intel_msic.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c index 25d486c543cb..2017446c5b4b 100644 --- a/drivers/mfd/intel_msic.c +++ b/drivers/mfd/intel_msic.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -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 "); -MODULE_LICENSE("GPL"); +builtin_platform_driver(intel_msic_driver); -- 2.8.4
[PATCH 2/6] mfd: as3722: convert MFD_AS3722 from bool to tristate
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_AS3722 drivers/mfd/Kconfig:bool "ams AS3722 Power Management IC" ...meaning that it currently is not being built as a module by anyone. In response to an earlier patch set suggesting removal of the unused modular code, Laxman suggested that this driver be instead moved to tristate. We do that here, and confirm it can build and modpost as a tristate. However there remains to be runtime testing in order to ensure this change is 100% functional for "=m". Cc: Samuel Ortiz Cc: Lee Jones Cc: Florian Lobmaier Cc: Laxman Dewangan Signed-off-by: Paul Gortmaker --- drivers/mfd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 9ac9f6250ba8..9a529bf06eed 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -50,7 +50,7 @@ config MFD_AS3711 Support for the AS3711 PMIC from AMS config MFD_AS3722 - bool "ams AS3722 Power Management IC" + tristate "ams AS3722 Power Management IC" select MFD_CORE select REGMAP_I2C select REGMAP_IRQ -- 2.8.4
[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_CORE drivers/mfd/Kconfig:bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support" ...meaning that it currently is not being built as a module by anyone. Lets remove what modular code that we can, so that when reading the driver there is less doubt that it is builtin-only. Note that we can't remove the twl_remove() itself ; it is still used by the probe unwind routine. So we leave it linked into the .remove as well, even though it will most likely never be called via that path from an unbind. Since module_i2c_driver() uses the same init level priority as builtin_i2c_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Tony Lindgren Cc: Samuel Ortiz Cc: Lee Jones Cc: linux-o...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/mfd/twl-core.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index a49d3db6d936..c64615dca2bd 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -1258,7 +1257,6 @@ static const struct i2c_device_id twl_ids[] = { { "twl6032", TWL6030_CLASS | TWL6032_SUBCLASS }, /* "Phoenix lite" */ { /* end of list */ }, }; -MODULE_DEVICE_TABLE(i2c, twl_ids); /* One Client Driver , 4 Clients */ static struct i2c_driver twl_driver = { @@ -1267,9 +1265,4 @@ static struct i2c_driver twl_driver = { .probe = twl_probe, .remove = twl_remove, }; - -module_i2c_driver(twl_driver); - -MODULE_AUTHOR("Texas Instruments, Inc."); -MODULE_DESCRIPTION("I2C Core interface for TWL"); -MODULE_LICENSE("GPL"); +builtin_i2c_driver(twl_driver); -- 2.8.4
[PATCH 5/6] mfd: sun6i-prcm: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config MFD_SUN6I_PRCM drivers/mfd/Kconfig:bool "Allwinner A31 PRCM controller" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple traces of modularity so that when reading the driver there is no doubt it is builtin-only. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Samuel Ortiz Cc: Lee Jones Cc: Maxime Ripard Acked-by: Maxime Ripard Cc: Boris BREZILLON Signed-off-by: Paul Gortmaker --- drivers/mfd/sun6i-prcm.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c index 191173166d65..011fcc555945 100644 --- a/drivers/mfd/sun6i-prcm.c +++ b/drivers/mfd/sun6i-prcm.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include 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 "); -MODULE_DESCRIPTION("Allwinner sun6i PRCM driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(sun6i_prcm_driver); -- 2.8.4
[PATCH] fmc: don't include moduleparam.h in include/linux header files.
We try to keep cross linkages between include/linux files to a minimum wherever possible. To that end, we avoid having the include/linux headers sourcing module.h or moduleparam.h (which sources module.h). Here we see moduleparam.h was included in one for the following: /* These are the generic parameters, that drivers may instantiate */ #define FMC_PARAM_BUSID(_d) \ module_param_array_named(busid, _d.busid_val, int, &_d.busid_n, 0444) #define FMC_PARAM_GATEWARE(_d) \ module_param_array_named(gateware, _d.gw_val, charp, &_d.gw_n, 0444) However, since they are #define, it is the driver's responsibility to include moduleparam.h should it decide to make use of any of these. So move the include to the one and only driver to use these macros and ensure we keep setting the proper example in include/linux headers. Cc: Alessandro Rubini <rub...@gnudd.com> Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/fmc/fmc-trivial.c | 1 + include/linux/fmc.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fmc/fmc-trivial.c b/drivers/fmc/fmc-trivial.c index 6c590f54c79d..44d93dd88a5f 100644 --- a/drivers/fmc/fmc-trivial.c +++ b/drivers/fmc/fmc-trivial.c @@ -13,6 +13,7 @@ /* A trivial fmc driver that can load a gateware file and reports interrupts */ #include +#include #include #include #include diff --git a/include/linux/fmc.h b/include/linux/fmc.h index a5f0aa5c2a8d..2aeea0a747a4 100644 --- a/include/linux/fmc.h +++ b/include/linux/fmc.h @@ -10,7 +10,6 @@ #ifndef __LINUX_FMC_H__ #define __LINUX_FMC_H__ #include -#include #include #include #include -- 2.8.4
[PATCH] fmc: don't include moduleparam.h in include/linux header files.
We try to keep cross linkages between include/linux files to a minimum wherever possible. To that end, we avoid having the include/linux headers sourcing module.h or moduleparam.h (which sources module.h). Here we see moduleparam.h was included in one for the following: /* These are the generic parameters, that drivers may instantiate */ #define FMC_PARAM_BUSID(_d) \ module_param_array_named(busid, _d.busid_val, int, &_d.busid_n, 0444) #define FMC_PARAM_GATEWARE(_d) \ module_param_array_named(gateware, _d.gw_val, charp, &_d.gw_n, 0444) However, since they are #define, it is the driver's responsibility to include moduleparam.h should it decide to make use of any of these. So move the include to the one and only driver to use these macros and ensure we keep setting the proper example in include/linux headers. Cc: Alessandro Rubini Signed-off-by: Paul Gortmaker --- drivers/fmc/fmc-trivial.c | 1 + include/linux/fmc.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fmc/fmc-trivial.c b/drivers/fmc/fmc-trivial.c index 6c590f54c79d..44d93dd88a5f 100644 --- a/drivers/fmc/fmc-trivial.c +++ b/drivers/fmc/fmc-trivial.c @@ -13,6 +13,7 @@ /* A trivial fmc driver that can load a gateware file and reports interrupts */ #include +#include #include #include #include diff --git a/include/linux/fmc.h b/include/linux/fmc.h index a5f0aa5c2a8d..2aeea0a747a4 100644 --- a/include/linux/fmc.h +++ b/include/linux/fmc.h @@ -10,7 +10,6 @@ #ifndef __LINUX_FMC_H__ #define __LINUX_FMC_H__ #include -#include #include #include #include -- 2.8.4
[ANNOUNCE] 4.8-rc5-rt1 beta
This is a carry forward of the -rt patches off v4.6.7-rt11 through mainline commits of v4.7 and up to the current v4.8-rc5. https://git.kernel.org/cgit/linux/kernel/git/paulg/4.8-rt-patches.git The repository only contains patches; this is aimed at being a stepping stone for developers who are experimenting with -rt and/or patching and building their own kernel trees. End users who have not created their own trees before really should stick with v4.6-rt. To be explicitly clear -- this does NOT imply any level of support, or any commitment to release an "official" -rt on any particular kernel version by anyone, myself included. This repo is meant to give more visibility into how the mainline commits since 4.6 will impact the existing 4.6-rt patches. This is achieved by updating the -rt patches in lock step with the new content as it was/is merged by Linus. The branches exist as fast forward work off of Sebastian's 4.6 patch history on the v4.6-rt. Patch conflicts/issues of interest -- What follows is probably only of interest to a select handful of people who are routinely hands on with the patches. It is a summary of the changes of interest; all of which are part of the above repo history, i.e. git whatchanged v4.7-rt..v4.8-rt but ignoring the more basic patch refresh steps with just simple context changes or obvious fixups. Patch conflicts/issues of interest 4.6 --> 4.7 -- -v4.7 introduced a lot of users of down_write_killable which wasn't implemented for -rt (rwsem_rt.h), so I created one. (see new patch rt-create-down_write_killable.patch -- local commit 14625e96ff085f), it probably warrants a look see from other people smarter than me. -Al Viro added a 2nd user of down_read_non_owner into NFS unlink. Previously it was just bcache and Sebastian just made that depend on !RT_FULL (md-disable-bcache.patch). So we'll need to decide what to with that; I just ignored NFS for now, since it is horrible anyway. (see upstream commit 884be175351e73c) -there was considerable rummaging around in mm/page_alloc.c that caused the two -rt patches in there to need more hands on refresh work than normal, but everything seems OK AFAICT. -task_rq_lock was expanded to take a struct rq_flags instead of the conventional lock flags; updated the patches to match (see upstream eb58075149b7f030 by peterz) -dcache.h gained an implicit include issue; probably can upstream the trivial fix right away; didn't investigate whether there are configs on mainline where it also breaks. (fixes d9171b9345261e ?) -about eight patches appeared upstream and were droppred from -rt. -I initially renamed a couple patches to match the default name as given by "git format-patch" but since that prevents ease of viewing the "diff of a patch" as a double check on the patch refresh, I stopped doing that after the 1st two or three patches. Patch conflicts/issues of interest 4.7 --> 4.8 -- -all the timer wheel rework being present in mainline meant we got to drop those patches from the -rt queue; about 21 patches in all. (11b68271256f28999 in this repo.) -the amount of stuff living in thread_info was being scaled back by luto (see upstream 13d4ea097d18b419) and as part of that the GET_THREAD_INFO macro got nuked. I temporarily reintroduced it close to the use case of x86 preempt lazy (local ID 822cf4179e6f) while we possibly reconsider where TIF_LAZY ends up living. -another implicit include issue popped up, this time in the header include/linux/rbtree_augmented.h (local patch added in commit 97cd8b0eeed6, fixes upstream commit c1adf20052d80); needs sending. -the net patch that replaced some per-cpu stuff with a variable in current had macros in dev.c for the RT vs. non-RT case; now filter.c needs those same macros, so they moved to netdevice.h where the other shared macro was already (local ID 8ff5e6ee96b file net-move-xmit_recursion-to-per-task-variable-on-RT.patch) -I dropped the two scsi-fcoe-* patches; it appears that what they were trying to fix on -rt will be fixed biy upstream 4b9bc86d5a99 but it probably warrants a second look by someone else. -the ARM at91 clksrc change has been temporarily dropped, after upstream got re-written to incorporate return values etc. It had already been dragged along kicking and screaming from 3.x days and probably needs love from someone with real hardware. -another 3 patches made it upstream, (not counting ones mentioned above) including the CR3 preempt issue fixed by Sebastian Process details: Rather than jump them forward all at once and then try and deal with all the new issues at once, I walked them forward step by step through the merges performed by Linus in each 2wk window leading up to the rc1 tag (where all the ~12k new commits appear). I've detailed this exact same process in more detail in
[ANNOUNCE] 4.8-rc5-rt1 beta
This is a carry forward of the -rt patches off v4.6.7-rt11 through mainline commits of v4.7 and up to the current v4.8-rc5. https://git.kernel.org/cgit/linux/kernel/git/paulg/4.8-rt-patches.git The repository only contains patches; this is aimed at being a stepping stone for developers who are experimenting with -rt and/or patching and building their own kernel trees. End users who have not created their own trees before really should stick with v4.6-rt. To be explicitly clear -- this does NOT imply any level of support, or any commitment to release an "official" -rt on any particular kernel version by anyone, myself included. This repo is meant to give more visibility into how the mainline commits since 4.6 will impact the existing 4.6-rt patches. This is achieved by updating the -rt patches in lock step with the new content as it was/is merged by Linus. The branches exist as fast forward work off of Sebastian's 4.6 patch history on the v4.6-rt. Patch conflicts/issues of interest -- What follows is probably only of interest to a select handful of people who are routinely hands on with the patches. It is a summary of the changes of interest; all of which are part of the above repo history, i.e. git whatchanged v4.7-rt..v4.8-rt but ignoring the more basic patch refresh steps with just simple context changes or obvious fixups. Patch conflicts/issues of interest 4.6 --> 4.7 -- -v4.7 introduced a lot of users of down_write_killable which wasn't implemented for -rt (rwsem_rt.h), so I created one. (see new patch rt-create-down_write_killable.patch -- local commit 14625e96ff085f), it probably warrants a look see from other people smarter than me. -Al Viro added a 2nd user of down_read_non_owner into NFS unlink. Previously it was just bcache and Sebastian just made that depend on !RT_FULL (md-disable-bcache.patch). So we'll need to decide what to with that; I just ignored NFS for now, since it is horrible anyway. (see upstream commit 884be175351e73c) -there was considerable rummaging around in mm/page_alloc.c that caused the two -rt patches in there to need more hands on refresh work than normal, but everything seems OK AFAICT. -task_rq_lock was expanded to take a struct rq_flags instead of the conventional lock flags; updated the patches to match (see upstream eb58075149b7f030 by peterz) -dcache.h gained an implicit include issue; probably can upstream the trivial fix right away; didn't investigate whether there are configs on mainline where it also breaks. (fixes d9171b9345261e ?) -about eight patches appeared upstream and were droppred from -rt. -I initially renamed a couple patches to match the default name as given by "git format-patch" but since that prevents ease of viewing the "diff of a patch" as a double check on the patch refresh, I stopped doing that after the 1st two or three patches. Patch conflicts/issues of interest 4.7 --> 4.8 -- -all the timer wheel rework being present in mainline meant we got to drop those patches from the -rt queue; about 21 patches in all. (11b68271256f28999 in this repo.) -the amount of stuff living in thread_info was being scaled back by luto (see upstream 13d4ea097d18b419) and as part of that the GET_THREAD_INFO macro got nuked. I temporarily reintroduced it close to the use case of x86 preempt lazy (local ID 822cf4179e6f) while we possibly reconsider where TIF_LAZY ends up living. -another implicit include issue popped up, this time in the header include/linux/rbtree_augmented.h (local patch added in commit 97cd8b0eeed6, fixes upstream commit c1adf20052d80); needs sending. -the net patch that replaced some per-cpu stuff with a variable in current had macros in dev.c for the RT vs. non-RT case; now filter.c needs those same macros, so they moved to netdevice.h where the other shared macro was already (local ID 8ff5e6ee96b file net-move-xmit_recursion-to-per-task-variable-on-RT.patch) -I dropped the two scsi-fcoe-* patches; it appears that what they were trying to fix on -rt will be fixed biy upstream 4b9bc86d5a99 but it probably warrants a second look by someone else. -the ARM at91 clksrc change has been temporarily dropped, after upstream got re-written to incorporate return values etc. It had already been dragged along kicking and screaming from 3.x days and probably needs love from someone with real hardware. -another 3 patches made it upstream, (not counting ones mentioned above) including the CR3 preempt issue fixed by Sebastian Process details: Rather than jump them forward all at once and then try and deal with all the new issues at once, I walked them forward step by step through the merges performed by Linus in each 2wk window leading up to the rc1 tag (where all the ~12k new commits appear). I've detailed this exact same process in more detail in
Re: [PATCH 0/5] reset: make non-modular drivers really non modular
[[PATCH 0/5] reset: make non-modular drivers really non modular] On 13/06/2016 (Mon 14:03) Paul Gortmaker wrote: > For anyone new to the underlying goal of this cleanup, we are trying to > not use module support for code that can never be built as a module since: Hi Phillip, Wondering what the status of these patches is, since I didn't see them in this recent merge in linux-next now that it has restarted again: -- commit 7d3ef43f1f99d4250ff120c8965b3e5cd81b3c71 Merge: 2b97f10b3896 cddb4800162e Author: Arnd Bergmann <a...@arndb.de> Date: Fri Sep 2 18:29:04 2016 +0200 Merge tag 'reset-for-4.9' of git://git.pengutronix.de/git/pza/linux into next/drivers Merge "Reset controller changes for v4.9" from Philipp Zabel: -- I believe there are at least two new instances in the reset drivers since these original five were sent to you back in June. The V1 didn't get any change requests, just some acks. Do you want a resend with the additional commits, and the Ack'd by from V1 added? Thanks, Paul. -- > > (1) it is easy to accidentally write unused module_exit and remove code > (2) it can be misleading when reading the source, thinking it can be > modular when the Makefile and/or Kconfig prohibit it > (3) it requires the include of the module.h header file which in turn > includes nearly everything else, thus adding to CPP overhead. > (4) it gets copied/replicated into other code and spreads like weeds. > > Fortunately the reset dir is in pretty good shape, and there are only > five instances of non-modular code using modular funcionality/macros. > > Changes seen here cover the following categories: > > -just replacement of modular macros with their non-modular >equivalents that CPP would have inserted anyway > > -the removal of including module.h ; replaced with init.h >as required based on whether the file already had it. > > -the removal of any ".remove" functions that were hooked into >the driver struct. This ".remove" function would of >course not be called from the __exit function since that was >never run. However in theory, someone could have triggered it >via sysfs unbind, even though there isn't a sensible use case >for doing so. So to cover that possibility, we've also disabled >sysfs unbind in the driver. > > Recently several of these drivers got removal of the ".remove" fcns > via other changes, so only one remains for which that happens here. > > There are no initcall level changes here; everything was at the level > of device_initcall and remains so, by using the builtin equivalents. > > Build tested for several different key arch on a recent linux-next > tree to ensure no silly typos crept in. > > If there is a desire for any of these to be modular, we can definitely > consider that, but by default the changes here keep the code consistent > with existing behaviour and do not expand functionality into the modular > realm that I can't run time test. > > Paul. > > --- > > Cc: Antoine Tenart <antoine.ten...@free-electrons.com> > Cc: Joachim Eastwood <manab...@gmail.com> > Cc: Masahiro Yamada <yamada.masah...@socionext.com> > Cc: Maxime Ripard <maxime.rip...@free-electrons.com> > Cc: Michal Simek <michal.si...@xilinx.com> > Cc: Moritz Fischer <moritz.fisc...@ettus.com> > Cc: Philipp Zabel <p.za...@pengutronix.de> > Cc: Sebastian Hesselbarth <sebastian.hesselba...@gmail.com> > Cc: "Sören Brinkmann" <soren.brinkm...@xilinx.com> > Cc: Steffen Trumtrar <s.trumt...@pengutronix.de> > > > Paul Gortmaker (5): > reset: berlin: make it explicitly non-modular > reset: socfpga: make it explicitly non-modular > reset: sunxi: make it explicitly non-modular > reset: zynq: make it explicitly non-modular > reset: lpc18xx: make it explicitly non-modular > > drivers/reset/reset-berlin.c | 12 > drivers/reset/reset-lpc18xx.c | 32 +--- > drivers/reset/reset-socfpga.c | 10 -- > drivers/reset/reset-sunxi.c | 9 ++--- > drivers/reset/reset-zynq.c| 10 -- > 5 files changed, 19 insertions(+), 54 deletions(-) > > -- > 2.8.4 >
Re: [PATCH 0/5] reset: make non-modular drivers really non modular
[[PATCH 0/5] reset: make non-modular drivers really non modular] On 13/06/2016 (Mon 14:03) Paul Gortmaker wrote: > For anyone new to the underlying goal of this cleanup, we are trying to > not use module support for code that can never be built as a module since: Hi Phillip, Wondering what the status of these patches is, since I didn't see them in this recent merge in linux-next now that it has restarted again: -- commit 7d3ef43f1f99d4250ff120c8965b3e5cd81b3c71 Merge: 2b97f10b3896 cddb4800162e Author: Arnd Bergmann Date: Fri Sep 2 18:29:04 2016 +0200 Merge tag 'reset-for-4.9' of git://git.pengutronix.de/git/pza/linux into next/drivers Merge "Reset controller changes for v4.9" from Philipp Zabel: -- I believe there are at least two new instances in the reset drivers since these original five were sent to you back in June. The V1 didn't get any change requests, just some acks. Do you want a resend with the additional commits, and the Ack'd by from V1 added? Thanks, Paul. -- > > (1) it is easy to accidentally write unused module_exit and remove code > (2) it can be misleading when reading the source, thinking it can be > modular when the Makefile and/or Kconfig prohibit it > (3) it requires the include of the module.h header file which in turn > includes nearly everything else, thus adding to CPP overhead. > (4) it gets copied/replicated into other code and spreads like weeds. > > Fortunately the reset dir is in pretty good shape, and there are only > five instances of non-modular code using modular funcionality/macros. > > Changes seen here cover the following categories: > > -just replacement of modular macros with their non-modular >equivalents that CPP would have inserted anyway > > -the removal of including module.h ; replaced with init.h >as required based on whether the file already had it. > > -the removal of any ".remove" functions that were hooked into >the driver struct. This ".remove" function would of >course not be called from the __exit function since that was >never run. However in theory, someone could have triggered it >via sysfs unbind, even though there isn't a sensible use case >for doing so. So to cover that possibility, we've also disabled >sysfs unbind in the driver. > > Recently several of these drivers got removal of the ".remove" fcns > via other changes, so only one remains for which that happens here. > > There are no initcall level changes here; everything was at the level > of device_initcall and remains so, by using the builtin equivalents. > > Build tested for several different key arch on a recent linux-next > tree to ensure no silly typos crept in. > > If there is a desire for any of these to be modular, we can definitely > consider that, but by default the changes here keep the code consistent > with existing behaviour and do not expand functionality into the modular > realm that I can't run time test. > > Paul. > > --- > > Cc: Antoine Tenart > Cc: Joachim Eastwood > Cc: Masahiro Yamada > Cc: Maxime Ripard > Cc: Michal Simek > Cc: Moritz Fischer > Cc: Philipp Zabel > Cc: Sebastian Hesselbarth > Cc: "Sören Brinkmann" > Cc: Steffen Trumtrar > > > Paul Gortmaker (5): > reset: berlin: make it explicitly non-modular > reset: socfpga: make it explicitly non-modular > reset: sunxi: make it explicitly non-modular > reset: zynq: make it explicitly non-modular > reset: lpc18xx: make it explicitly non-modular > > drivers/reset/reset-berlin.c | 12 > drivers/reset/reset-lpc18xx.c | 32 +--- > drivers/reset/reset-socfpga.c | 10 -- > drivers/reset/reset-sunxi.c | 9 ++--- > drivers/reset/reset-zynq.c| 10 -- > 5 files changed, 19 insertions(+), 54 deletions(-) > > -- > 2.8.4 >
[PATCH 3/9] PCI: PCIe aerdrv: make it explicitly non-modular
The Makefile fragments currently controlling compilation of this code are: obj-$(CONFIG_PCIEAER) += aerdriver.o aerdriver-objs := aerdrv_errprint.o aerdrv_core.o aerdrv.o The Kconfig currently controlling compilation of this code is: drivers/pci/pcie/aer/Kconfig:config PCIEAER drivers/pci/pcie/aer/Kconfig: bool "Root Port Advanced Error Reporting 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 don't replace module.h with init.h since the file already has that. We also delete the MODULE_LICENSE tag etc since all that information is already contained earlier in the file. Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Tom Long Nguyen <tom.l.ngu...@intel.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/pcie/aer/aerdrv.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 48d21e0edd56..49805a48b81c 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c @@ -15,7 +15,6 @@ * */ -#include #include #include #include @@ -37,9 +36,6 @@ #define DRIVER_VERSION "v1.0" #define DRIVER_AUTHOR "tom.l.ngu...@intel.com" #define DRIVER_DESC "Root Port Advanced Error Reporting Driver" -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); static int aer_probe(struct pcie_device *dev); static void aer_remove(struct pcie_device *dev); @@ -417,16 +413,4 @@ static int __init aer_service_init(void) return -ENXIO; return pcie_port_service_register(); } - -/** - * aer_service_exit - unregister AER root service driver - * - * Invoked when AER root service driver is unloaded. - */ -static void __exit aer_service_exit(void) -{ - pcie_port_service_unregister(); -} - -module_init(aer_service_init); -module_exit(aer_service_exit); +device_initcall(aer_service_init); -- 2.8.4
[PATCH 3/9] PCI: PCIe aerdrv: make it explicitly non-modular
The Makefile fragments currently controlling compilation of this code are: obj-$(CONFIG_PCIEAER) += aerdriver.o aerdriver-objs := aerdrv_errprint.o aerdrv_core.o aerdrv.o The Kconfig currently controlling compilation of this code is: drivers/pci/pcie/aer/Kconfig:config PCIEAER drivers/pci/pcie/aer/Kconfig: bool "Root Port Advanced Error Reporting 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 don't replace module.h with init.h since the file already has that. We also delete the MODULE_LICENSE tag etc since all that information is already contained earlier in the file. Cc: Bjorn Helgaas Cc: Tom Long Nguyen Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/pcie/aer/aerdrv.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 48d21e0edd56..49805a48b81c 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c @@ -15,7 +15,6 @@ * */ -#include #include #include #include @@ -37,9 +36,6 @@ #define DRIVER_VERSION "v1.0" #define DRIVER_AUTHOR "tom.l.ngu...@intel.com" #define DRIVER_DESC "Root Port Advanced Error Reporting Driver" -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); static int aer_probe(struct pcie_device *dev); static void aer_remove(struct pcie_device *dev); @@ -417,16 +413,4 @@ static int __init aer_service_init(void) return -ENXIO; return pcie_port_service_register(); } - -/** - * aer_service_exit - unregister AER root service driver - * - * Invoked when AER root service driver is unloaded. - */ -static void __exit aer_service_exit(void) -{ - pcie_port_service_unregister(); -} - -module_init(aer_service_init); -module_exit(aer_service_exit); +device_initcall(aer_service_init); -- 2.8.4
[PATCH 2/9] PCI: PCIe pme: make it explicitly non-modular
The Kconfig for this option is currently: config PCIE_PME def_bool y depends on PCIEPORTBUS && PM ...where both dependencies are also bool items. That means it currently is not being built as a module by anyone. Lets remove all traces of modularity, so that when reading the code, there is no doubt it is builtin-only. As part of that, we delete the .remove function, since that doesn't seem to have a sensible use case. With "normal" endpoint drivers, we have in the past set the suppress_bind_attrs bit to make it clear that the use of ".remove" in a built-in driver was deleted, but here for PCI, it would seem to be overkill to jump through the pcie_port_service_driver and into the struct device_driver in order to finally try and do something similar with the bind setting. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We don't exchange module.h for init.h since this file already has it. Cc: Bjorn Helgaas <bhelg...@google.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/pcie/pme.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c index 1ae4c73e7a3c..884bad5320f8 100644 --- a/drivers/pci/pcie/pme.c +++ b/drivers/pci/pcie/pme.c @@ -10,7 +10,6 @@ * for more details. */ -#include #include #include #include @@ -449,17 +448,6 @@ static int pcie_pme_resume(struct pcie_device *srv) return 0; } -/** - * pcie_pme_remove - Prepare PCIe PME service device for removal. - * @srv - PCIe service device to remove. - */ -static void pcie_pme_remove(struct pcie_device *srv) -{ - pcie_pme_suspend(srv); - free_irq(srv->irq, srv); - kfree(get_service_data(srv)); -} - static struct pcie_port_service_driver pcie_pme_driver = { .name = "pcie_pme", .port_type = PCI_EXP_TYPE_ROOT_PORT, @@ -468,7 +456,6 @@ static struct pcie_port_service_driver pcie_pme_driver = { .probe = pcie_pme_probe, .suspend= pcie_pme_suspend, .resume = pcie_pme_resume, - .remove = pcie_pme_remove, }; /** @@ -478,5 +465,4 @@ static int __init pcie_pme_service_init(void) { return pcie_port_service_register(_pme_driver); } - -module_init(pcie_pme_service_init); +device_initcall(pcie_pme_service_init); -- 2.8.4
[PATCH 2/9] PCI: PCIe pme: make it explicitly non-modular
The Kconfig for this option is currently: config PCIE_PME def_bool y depends on PCIEPORTBUS && PM ...where both dependencies are also bool items. That means it currently is not being built as a module by anyone. Lets remove all traces of modularity, so that when reading the code, there is no doubt it is builtin-only. As part of that, we delete the .remove function, since that doesn't seem to have a sensible use case. With "normal" endpoint drivers, we have in the past set the suppress_bind_attrs bit to make it clear that the use of ".remove" in a built-in driver was deleted, but here for PCI, it would seem to be overkill to jump through the pcie_port_service_driver and into the struct device_driver in order to finally try and do something similar with the bind setting. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We don't exchange module.h for init.h since this file already has it. Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/pcie/pme.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c index 1ae4c73e7a3c..884bad5320f8 100644 --- a/drivers/pci/pcie/pme.c +++ b/drivers/pci/pcie/pme.c @@ -10,7 +10,6 @@ * for more details. */ -#include #include #include #include @@ -449,17 +448,6 @@ static int pcie_pme_resume(struct pcie_device *srv) return 0; } -/** - * pcie_pme_remove - Prepare PCIe PME service device for removal. - * @srv - PCIe service device to remove. - */ -static void pcie_pme_remove(struct pcie_device *srv) -{ - pcie_pme_suspend(srv); - free_irq(srv->irq, srv); - kfree(get_service_data(srv)); -} - static struct pcie_port_service_driver pcie_pme_driver = { .name = "pcie_pme", .port_type = PCI_EXP_TYPE_ROOT_PORT, @@ -468,7 +456,6 @@ static struct pcie_port_service_driver pcie_pme_driver = { .probe = pcie_pme_probe, .suspend= pcie_pme_suspend, .resume = pcie_pme_resume, - .remove = pcie_pme_remove, }; /** @@ -478,5 +465,4 @@ static int __init pcie_pme_service_init(void) { return pcie_port_service_register(_pme_driver); } - -module_init(pcie_pme_service_init); +device_initcall(pcie_pme_service_init); -- 2.8.4
[PATCH 7/9] PCI: PCIe xilinx-nwl: make host code explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_XILINX_NWL drivers/pci/host/Kconfig: bool "NWL PCIe Core" ...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. Several functions only used by the remove function are also deleted here. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Michal Simek <michal.si...@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkm...@xilinx.com> Cc: Marc Zyngier <marc.zyng...@arm.com> Cc: Bharat Kumar Gogada <bharat.kumar.gog...@xilinx.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pcie-xilinx-nwl.c | 53 +++--- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index 0b597d9190b4..df7fb8b69658 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -459,40 +459,6 @@ static const struct irq_domain_ops dev_msi_domain_ops = { .free = nwl_irq_domain_free, }; -static void nwl_msi_free_irq_domain(struct nwl_pcie *pcie) -{ - struct nwl_msi *msi = >msi; - - if (msi->irq_msi0) - irq_set_chained_handler_and_data(msi->irq_msi0, NULL, NULL); - if (msi->irq_msi1) - irq_set_chained_handler_and_data(msi->irq_msi1, NULL, NULL); - - if (msi->msi_domain) - irq_domain_remove(msi->msi_domain); - if (msi->dev_domain) - irq_domain_remove(msi->dev_domain); - - kfree(msi->bitmap); - msi->bitmap = NULL; -} - -static void nwl_pcie_free_irq_domain(struct nwl_pcie *pcie) -{ - int i; - u32 irq; - - for (i = 0; i < INTX_NUM; i++) { - irq = irq_find_mapping(pcie->legacy_irq_domain, i + 1); - if (irq > 0) - irq_dispose_mapping(irq); - } - if (pcie->legacy_irq_domain) - irq_domain_remove(pcie->legacy_irq_domain); - - nwl_msi_free_irq_domain(pcie); -} - static int nwl_pcie_init_msi_irq_domain(struct nwl_pcie *pcie) { #ifdef CONFIG_PCI_MSI @@ -867,25 +833,12 @@ error: return err; } -static int nwl_pcie_remove(struct platform_device *pdev) -{ - struct nwl_pcie *pcie = platform_get_drvdata(pdev); - - nwl_pcie_free_irq_domain(pcie); - platform_set_drvdata(pdev, NULL); - return 0; -} - static struct platform_driver nwl_pcie_driver = { .driver = { .name = "nwl-pcie", + .suppress_bind_attrs = true, .of_match_table = nwl_pcie_of_match, }, .probe = nwl_pcie_probe, - .remove = nwl_pcie_remove, }; -module_platform_driver(nwl_pcie_driver); - -MODULE_AUTHOR("Xilinx, Inc"); -MODULE_DESCRIPTION("NWL PCIe driver"); -MODULE_LICENSE("GPL"); +builtin_platform_driver(nwl_pcie_driver); -- 2.8.4
[PATCH 4/9] PCI: dra7xx: make host code explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCI_DRA7XX drivers/pci/host/Kconfig: bool "TI DRA7xx PCIe controller" ...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_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Kishon Vijay Abraham I <kis...@ti.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: linux-o...@vger.kernel.org Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pci-dra7xx.c | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c index 81b3949a26db..19223ed2e619 100644 --- a/drivers/pci/host/pci-dra7xx.c +++ b/drivers/pci/host/pci-dra7xx.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -443,25 +443,6 @@ err_phy: return ret; } -static int __exit dra7xx_pcie_remove(struct platform_device *pdev) -{ - struct dra7xx_pcie *dra7xx = platform_get_drvdata(pdev); - struct pcie_port *pp = >pp; - struct device *dev = >dev; - int count = dra7xx->phy_count; - - if (pp->irq_domain) - irq_domain_remove(pp->irq_domain); - pm_runtime_put(dev); - pm_runtime_disable(dev); - while (count--) { - phy_power_off(dra7xx->phy[count]); - phy_exit(dra7xx->phy[count]); - } - - return 0; -} - #ifdef CONFIG_PM_SLEEP static int dra7xx_pcie_suspend(struct device *dev) { @@ -545,19 +526,13 @@ static const struct of_device_id of_dra7xx_pcie_match[] = { { .compatible = "ti,dra7-pcie", }, {}, }; -MODULE_DEVICE_TABLE(of, of_dra7xx_pcie_match); static struct platform_driver dra7xx_pcie_driver = { - .remove = __exit_p(dra7xx_pcie_remove), .driver = { .name = "dra7-pcie", .of_match_table = of_dra7xx_pcie_match, + .suppress_bind_attrs = true, .pm = _pcie_pm_ops, }, }; - -module_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe); - -MODULE_AUTHOR("Kishon Vijay Abraham I <kis...@ti.com>"); -MODULE_DESCRIPTION("TI PCIe controller driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe); -- 2.8.4
[PATCH 7/9] PCI: PCIe xilinx-nwl: make host code explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_XILINX_NWL drivers/pci/host/Kconfig: bool "NWL PCIe Core" ...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. Several functions only used by the remove function are also deleted here. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Bjorn Helgaas Cc: Michal Simek Cc: "Sören Brinkmann" Cc: Marc Zyngier Cc: Bharat Kumar Gogada Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pcie-xilinx-nwl.c | 53 +++--- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index 0b597d9190b4..df7fb8b69658 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -459,40 +459,6 @@ static const struct irq_domain_ops dev_msi_domain_ops = { .free = nwl_irq_domain_free, }; -static void nwl_msi_free_irq_domain(struct nwl_pcie *pcie) -{ - struct nwl_msi *msi = >msi; - - if (msi->irq_msi0) - irq_set_chained_handler_and_data(msi->irq_msi0, NULL, NULL); - if (msi->irq_msi1) - irq_set_chained_handler_and_data(msi->irq_msi1, NULL, NULL); - - if (msi->msi_domain) - irq_domain_remove(msi->msi_domain); - if (msi->dev_domain) - irq_domain_remove(msi->dev_domain); - - kfree(msi->bitmap); - msi->bitmap = NULL; -} - -static void nwl_pcie_free_irq_domain(struct nwl_pcie *pcie) -{ - int i; - u32 irq; - - for (i = 0; i < INTX_NUM; i++) { - irq = irq_find_mapping(pcie->legacy_irq_domain, i + 1); - if (irq > 0) - irq_dispose_mapping(irq); - } - if (pcie->legacy_irq_domain) - irq_domain_remove(pcie->legacy_irq_domain); - - nwl_msi_free_irq_domain(pcie); -} - static int nwl_pcie_init_msi_irq_domain(struct nwl_pcie *pcie) { #ifdef CONFIG_PCI_MSI @@ -867,25 +833,12 @@ error: return err; } -static int nwl_pcie_remove(struct platform_device *pdev) -{ - struct nwl_pcie *pcie = platform_get_drvdata(pdev); - - nwl_pcie_free_irq_domain(pcie); - platform_set_drvdata(pdev, NULL); - return 0; -} - static struct platform_driver nwl_pcie_driver = { .driver = { .name = "nwl-pcie", + .suppress_bind_attrs = true, .of_match_table = nwl_pcie_of_match, }, .probe = nwl_pcie_probe, - .remove = nwl_pcie_remove, }; -module_platform_driver(nwl_pcie_driver); - -MODULE_AUTHOR("Xilinx, Inc"); -MODULE_DESCRIPTION("NWL PCIe driver"); -MODULE_LICENSE("GPL"); +builtin_platform_driver(nwl_pcie_driver); -- 2.8.4
[PATCH 4/9] PCI: dra7xx: make host code explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCI_DRA7XX drivers/pci/host/Kconfig: bool "TI DRA7xx PCIe controller" ...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_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Kishon Vijay Abraham I Cc: Bjorn Helgaas Cc: linux-o...@vger.kernel.org Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pci-dra7xx.c | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c index 81b3949a26db..19223ed2e619 100644 --- a/drivers/pci/host/pci-dra7xx.c +++ b/drivers/pci/host/pci-dra7xx.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -443,25 +443,6 @@ err_phy: return ret; } -static int __exit dra7xx_pcie_remove(struct platform_device *pdev) -{ - struct dra7xx_pcie *dra7xx = platform_get_drvdata(pdev); - struct pcie_port *pp = >pp; - struct device *dev = >dev; - int count = dra7xx->phy_count; - - if (pp->irq_domain) - irq_domain_remove(pp->irq_domain); - pm_runtime_put(dev); - pm_runtime_disable(dev); - while (count--) { - phy_power_off(dra7xx->phy[count]); - phy_exit(dra7xx->phy[count]); - } - - return 0; -} - #ifdef CONFIG_PM_SLEEP static int dra7xx_pcie_suspend(struct device *dev) { @@ -545,19 +526,13 @@ static const struct of_device_id of_dra7xx_pcie_match[] = { { .compatible = "ti,dra7-pcie", }, {}, }; -MODULE_DEVICE_TABLE(of, of_dra7xx_pcie_match); static struct platform_driver dra7xx_pcie_driver = { - .remove = __exit_p(dra7xx_pcie_remove), .driver = { .name = "dra7-pcie", .of_match_table = of_dra7xx_pcie_match, + .suppress_bind_attrs = true, .pm = _pcie_pm_ops, }, }; - -module_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe); - -MODULE_AUTHOR("Kishon Vijay Abraham I "); -MODULE_DESCRIPTION("TI PCIe controller driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe); -- 2.8.4
[PATCH 5/9] PCI: PCIe qcom: make host code explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_QCOM drivers/pci/host/Kconfig: bool "Qualcomm PCIe controller" ...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_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Cc: Stanimir Varbanov <svarba...@mm-sol.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pcie-qcom.c | 28 +++- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/pci/host/pcie-qcom.c b/drivers/pci/host/pcie-qcom.c index f2f90c50f75d..5ec2d440a6b7 100644 --- a/drivers/pci/host/pcie-qcom.c +++ b/drivers/pci/host/pcie-qcom.c @@ -1,7 +1,11 @@ /* + * Qualcomm PCIe root complex driver + * * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. * Copyright 2015 Linaro Limited. * + * Author: Stanimir Varbanov <svarba...@mm-sol.com> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. @@ -19,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -570,37 +574,19 @@ static int qcom_pcie_probe(struct platform_device *pdev) return 0; } -static int qcom_pcie_remove(struct platform_device *pdev) -{ - struct qcom_pcie *pcie = platform_get_drvdata(pdev); - - qcom_ep_reset_assert(pcie); - phy_power_off(pcie->phy); - phy_exit(pcie->phy); - pcie->ops->deinit(pcie); - - return 0; -} - static const struct of_device_id qcom_pcie_match[] = { { .compatible = "qcom,pcie-ipq8064", .data = _v0 }, { .compatible = "qcom,pcie-apq8064", .data = _v0 }, { .compatible = "qcom,pcie-apq8084", .data = _v1 }, { } }; -MODULE_DEVICE_TABLE(of, qcom_pcie_match); static struct platform_driver qcom_pcie_driver = { .probe = qcom_pcie_probe, - .remove = qcom_pcie_remove, .driver = { .name = "qcom-pcie", + .suppress_bind_attrs = true, .of_match_table = qcom_pcie_match, }, }; - -module_platform_driver(qcom_pcie_driver); - -MODULE_AUTHOR("Stanimir Varbanov <svarba...@mm-sol.com>"); -MODULE_DESCRIPTION("Qualcomm PCIe root complex driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(qcom_pcie_driver); -- 2.8.4
[PATCH 5/9] PCI: PCIe qcom: make host code explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_QCOM drivers/pci/host/Kconfig: bool "Qualcomm PCIe controller" ...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_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Cc: Stanimir Varbanov Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pcie-qcom.c | 28 +++- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/pci/host/pcie-qcom.c b/drivers/pci/host/pcie-qcom.c index f2f90c50f75d..5ec2d440a6b7 100644 --- a/drivers/pci/host/pcie-qcom.c +++ b/drivers/pci/host/pcie-qcom.c @@ -1,7 +1,11 @@ /* + * Qualcomm PCIe root complex driver + * * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. * Copyright 2015 Linaro Limited. * + * Author: Stanimir Varbanov + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. @@ -19,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -570,37 +574,19 @@ static int qcom_pcie_probe(struct platform_device *pdev) return 0; } -static int qcom_pcie_remove(struct platform_device *pdev) -{ - struct qcom_pcie *pcie = platform_get_drvdata(pdev); - - qcom_ep_reset_assert(pcie); - phy_power_off(pcie->phy); - phy_exit(pcie->phy); - pcie->ops->deinit(pcie); - - return 0; -} - static const struct of_device_id qcom_pcie_match[] = { { .compatible = "qcom,pcie-ipq8064", .data = _v0 }, { .compatible = "qcom,pcie-apq8064", .data = _v0 }, { .compatible = "qcom,pcie-apq8084", .data = _v1 }, { } }; -MODULE_DEVICE_TABLE(of, qcom_pcie_match); static struct platform_driver qcom_pcie_driver = { .probe = qcom_pcie_probe, - .remove = qcom_pcie_remove, .driver = { .name = "qcom-pcie", + .suppress_bind_attrs = true, .of_match_table = qcom_pcie_match, }, }; - -module_platform_driver(qcom_pcie_driver); - -MODULE_AUTHOR("Stanimir Varbanov "); -MODULE_DESCRIPTION("Qualcomm PCIe root complex driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(qcom_pcie_driver); -- 2.8.4
[PATCH 8/9] PCI: hotplug_core: make it explicitly non-modular
The Makefile bits currently controlling compilation of this code are: obj-$(CONFIG_HOTPLUG_PCI) += pci_hotplug.o [...] pci_hotplug-objs:= pci_hotplug_core.o and the Kconfig is: drivers/pci/hotplug/Kconfig:menuconfig HOTPLUG_PCI drivers/pci/hotplug/Kconfig:bool "Support for PCI Hotplug" ...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. This makes an exit function in cpci_hotplug_core.c orphaned, so we remove it here at the same time. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. However one could argue that we should use subsys_initcall() here, but for now we stick with runtime equivalence. We would delete module.h and just keep the moduleparam.h include (since the file does use module_param), but there is a try_module_get and module_put pairing that prevents us from doing that. We also delete the MODULE_LICENSE tag etc since all that information is already contained higher up in the file. Cc: Scott Murray <sc...@spiteful.org> Cc: kristen.c.acca...@intel.com Cc: Bjorn Helgaas <bhelg...@google.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/hotplug/cpci_hotplug.h | 2 -- drivers/pci/hotplug/cpci_hotplug_core.c | 10 -- drivers/pci/hotplug/pci_hotplug_core.c | 18 ++ 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h index 555bcde3b196..60e66e027ebc 100644 --- a/drivers/pci/hotplug/cpci_hotplug.h +++ b/drivers/pci/hotplug/cpci_hotplug.h @@ -101,10 +101,8 @@ int cpci_unconfigure_slot(struct slot *slot); #ifdef CONFIG_HOTPLUG_PCI_CPCI int cpci_hotplug_init(int debug); -void cpci_hotplug_exit(void); #else static inline int cpci_hotplug_init(int debug) { return 0; } -static inline void cpci_hotplug_exit(void) { } #endif #endif /* _CPCI_HOTPLUG_H */ diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 7d3866c47312..7ec8a8f72c69 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c @@ -719,13 +719,3 @@ cpci_hotplug_init(int debug) cpci_debug = debug; return 0; } - -void __exit -cpci_hotplug_exit(void) -{ - /* -* Clean everything up. -*/ - cpci_hp_stop(); - cpci_hp_unregister_controller(controller); -} diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 9acd1997c6fe..fea0b8b33589 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -25,7 +25,7 @@ * */ -#include +#include /* try_module_get & module_put */ #include #include #include @@ -537,17 +537,11 @@ static int __init pci_hotplug_init(void) info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); return result; } +device_initcall(pci_hotplug_init); -static void __exit pci_hotplug_exit(void) -{ - cpci_hotplug_exit(); -} - -module_init(pci_hotplug_init); -module_exit(pci_hotplug_exit); - -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); +/* + * not really modular, but the easiest way to keep compat with existing + * bootargs behaviour is to continue using module_param here. + */ module_param(debug, bool, 0644); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); -- 2.8.4
[PATCH 1/9] PCI: PCIe dpc: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/pcie/Kconfig:config PCIE_DPC drivers/pci/pcie/Kconfig: bool "PCIe Downstream Port Containment 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 was (or is now) contained at the top of the file in the comments. Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Keith Busch <keith.bu...@intel.com> Cc: Mika Westerberg <mika.westerb...@linux.intel.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/pcie/pcie-dpc.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c index 250f87861786..9811b14d9ad8 100644 --- a/drivers/pci/pcie/pcie-dpc.c +++ b/drivers/pci/pcie/pcie-dpc.c @@ -1,5 +1,7 @@ /* * PCI Express Downstream Port Containment services driver + * Author: Keith Busch <keith.bu...@intel.com> + * * Copyright (C) 2016 Intel Corp. * * This file is subject to the terms and conditions of the GNU General Public @@ -9,7 +11,7 @@ #include #include -#include +#include #include #include @@ -143,16 +145,4 @@ static int __init dpc_service_init(void) { return pcie_port_service_register(); } - -static void __exit dpc_service_exit(void) -{ - pcie_port_service_unregister(); -} - -MODULE_DESCRIPTION("PCI Express Downstream Port Containment driver"); -MODULE_AUTHOR("Keith Busch <keith.bu...@intel.com>"); -MODULE_LICENSE("GPL"); -MODULE_VERSION("0.1"); - -module_init(dpc_service_init); -module_exit(dpc_service_exit); +device_initcall(dpc_service_init); -- 2.8.4
[PATCH 0/9] PCI: final demodularization of non-modular code
This final (assuming more new instances don't leak back in) series ensures all the PCI code out there that remains using module.h is actually modular or containing some use of modular infrastructure. These last commits are slightly more involved than some of the earlier ones since we are actually removing orphaned __exit functions and some ".remove" functions as well. So we can't claim binary equivalence here, but the overall runtime should remain unchanged. To that end, we have remained with the existing initcall levels even though some of the hotplug infrastructural ones might make better sense to be listed as subsys_initcall or similar. Build tested with allmodconfig on all the major architectures. Paul. --- Cc: Bharat Kumar Gogada <bharat.kumar.gog...@xilinx.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Keith Busch <keith.bu...@intel.com> Cc: Kishon Vijay Abraham I <kis...@ti.com> Cc: kristen.c.acca...@intel.com Cc: Marc Zyngier <marc.zyng...@arm.com> Cc: Michal Simek <michal.si...@xilinx.com> Cc: Mika Westerberg <mika.westerb...@linux.intel.com> Cc: Scott Murray <sc...@spiteful.org> Cc: "Sören Brinkmann" <soren.brinkm...@xilinx.com> Cc: Stanimir Varbanov <svarba...@mm-sol.com> Cc: Tom Long Nguyen <tom.l.ngu...@intel.com> Cc: linux-o...@vger.kernel.org Cc: linux-...@vger.kernel.org Paul Gortmaker (9): PCI: PCIe dpc: make it explicitly non-modular PCI: PCIe pme: make it explicitly non-modular PCI: PCIe aerdrv: make it explicitly non-modular PCI: dra7xx: make host code explicitly non-modular PCI: PCIe qcom: make host code explicitly non-modular PCI: PCIe xilinx: make host code explicitly non-modular PCI: PCIe xilinx-nwl: make host code explicitly non-modular PCI: hotplug_core: make it explicitly non-modular PCI: hotplug: make PCIe core code explicitly non-modular drivers/pci/host/pci-dra7xx.c | 31 ++- drivers/pci/host/pcie-qcom.c| 28 + drivers/pci/host/pcie-xilinx-nwl.c | 53 ++--- drivers/pci/host/pcie-xilinx.c | 53 ++--- drivers/pci/hotplug/cpci_hotplug.h | 2 -- drivers/pci/hotplug/cpci_hotplug_core.c | 10 --- drivers/pci/hotplug/pci_hotplug_core.c | 18 --- drivers/pci/hotplug/pciehp_core.c | 20 - drivers/pci/pcie/aer/aerdrv.c | 18 +-- drivers/pci/pcie/pcie-dpc.c | 18 +++ drivers/pci/pcie/pme.c | 16 +- 11 files changed, 32 insertions(+), 235 deletions(-) -- 2.8.4
[PATCH 9/9] PCI: hotplug: make PCIe core code explicitly non-modular
The Makefile fragments currently controlling compilation of this code are: obj-$(CONFIG_HOTPLUG_PCI_PCIE) += pciehp.o [...] pciehp-objs := pciehp_core.o \ The Kconfig currently controlling compilation of this code is: drivers/pci/pcie/Kconfig:config HOTPLUG_PCI_PCIE drivers/pci/pcie/Kconfig: bool "PCI Express Hotplug driver" ...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. However one could argue that we should use subsys_initcall() here, but for now we stick with runtime equivalence. We delete module.h but we keep the moduleparam.h include, since we are keeping the module_param() that the file has as-is for now. We also delete the MODULE_LICENSE tag etc since all that information is still contained higher up in the file via the DEFINE lines which now serve as documentation only. Cc: Bjorn Helgaas <bhelg...@google.com> Cc: kristen.c.acca...@intel.com Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/hotplug/pciehp_core.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index ac531e674a05..fb0f86335158 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -27,7 +27,6 @@ * */ -#include #include #include #include @@ -47,10 +46,10 @@ static bool pciehp_force; #define DRIVER_AUTHOR "Dan Zink <dan.z...@compaq.com>, Greg Kroah-Hartman <g...@kroah.com>, Dely Sy <dely.l...@intel.com>" #define DRIVER_DESC"PCI Express Hot Plug Controller Driver" -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); - +/* + * not really modular, but the easiest way to keep compat with existing + * bootargs behaviour is to continue using module_param here. + */ module_param(pciehp_debug, bool, 0644); module_param(pciehp_poll_mode, bool, 0644); module_param(pciehp_poll_time, int, 0644); @@ -337,13 +336,4 @@ static int __init pcied_init(void) return retval; } - -static void __exit pcied_cleanup(void) -{ - dbg("unload_pciehpd()\n"); - pcie_port_service_unregister(_portdrv); - info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); -} - -module_init(pcied_init); -module_exit(pcied_cleanup); +device_initcall(pcied_init); -- 2.8.4
[PATCH 8/9] PCI: hotplug_core: make it explicitly non-modular
The Makefile bits currently controlling compilation of this code are: obj-$(CONFIG_HOTPLUG_PCI) += pci_hotplug.o [...] pci_hotplug-objs:= pci_hotplug_core.o and the Kconfig is: drivers/pci/hotplug/Kconfig:menuconfig HOTPLUG_PCI drivers/pci/hotplug/Kconfig:bool "Support for PCI Hotplug" ...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. This makes an exit function in cpci_hotplug_core.c orphaned, so we remove it here at the same time. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. However one could argue that we should use subsys_initcall() here, but for now we stick with runtime equivalence. We would delete module.h and just keep the moduleparam.h include (since the file does use module_param), but there is a try_module_get and module_put pairing that prevents us from doing that. We also delete the MODULE_LICENSE tag etc since all that information is already contained higher up in the file. Cc: Scott Murray Cc: kristen.c.acca...@intel.com Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/hotplug/cpci_hotplug.h | 2 -- drivers/pci/hotplug/cpci_hotplug_core.c | 10 -- drivers/pci/hotplug/pci_hotplug_core.c | 18 ++ 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h index 555bcde3b196..60e66e027ebc 100644 --- a/drivers/pci/hotplug/cpci_hotplug.h +++ b/drivers/pci/hotplug/cpci_hotplug.h @@ -101,10 +101,8 @@ int cpci_unconfigure_slot(struct slot *slot); #ifdef CONFIG_HOTPLUG_PCI_CPCI int cpci_hotplug_init(int debug); -void cpci_hotplug_exit(void); #else static inline int cpci_hotplug_init(int debug) { return 0; } -static inline void cpci_hotplug_exit(void) { } #endif #endif /* _CPCI_HOTPLUG_H */ diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 7d3866c47312..7ec8a8f72c69 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c @@ -719,13 +719,3 @@ cpci_hotplug_init(int debug) cpci_debug = debug; return 0; } - -void __exit -cpci_hotplug_exit(void) -{ - /* -* Clean everything up. -*/ - cpci_hp_stop(); - cpci_hp_unregister_controller(controller); -} diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 9acd1997c6fe..fea0b8b33589 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -25,7 +25,7 @@ * */ -#include +#include /* try_module_get & module_put */ #include #include #include @@ -537,17 +537,11 @@ static int __init pci_hotplug_init(void) info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); return result; } +device_initcall(pci_hotplug_init); -static void __exit pci_hotplug_exit(void) -{ - cpci_hotplug_exit(); -} - -module_init(pci_hotplug_init); -module_exit(pci_hotplug_exit); - -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); +/* + * not really modular, but the easiest way to keep compat with existing + * bootargs behaviour is to continue using module_param here. + */ module_param(debug, bool, 0644); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); -- 2.8.4
[PATCH 1/9] PCI: PCIe dpc: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/pcie/Kconfig:config PCIE_DPC drivers/pci/pcie/Kconfig: bool "PCIe Downstream Port Containment 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 was (or is now) contained at the top of the file in the comments. Cc: Bjorn Helgaas Cc: Keith Busch Cc: Mika Westerberg Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/pcie/pcie-dpc.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c index 250f87861786..9811b14d9ad8 100644 --- a/drivers/pci/pcie/pcie-dpc.c +++ b/drivers/pci/pcie/pcie-dpc.c @@ -1,5 +1,7 @@ /* * PCI Express Downstream Port Containment services driver + * Author: Keith Busch + * * Copyright (C) 2016 Intel Corp. * * This file is subject to the terms and conditions of the GNU General Public @@ -9,7 +11,7 @@ #include #include -#include +#include #include #include @@ -143,16 +145,4 @@ static int __init dpc_service_init(void) { return pcie_port_service_register(); } - -static void __exit dpc_service_exit(void) -{ - pcie_port_service_unregister(); -} - -MODULE_DESCRIPTION("PCI Express Downstream Port Containment driver"); -MODULE_AUTHOR("Keith Busch "); -MODULE_LICENSE("GPL"); -MODULE_VERSION("0.1"); - -module_init(dpc_service_init); -module_exit(dpc_service_exit); +device_initcall(dpc_service_init); -- 2.8.4
[PATCH 0/9] PCI: final demodularization of non-modular code
This final (assuming more new instances don't leak back in) series ensures all the PCI code out there that remains using module.h is actually modular or containing some use of modular infrastructure. These last commits are slightly more involved than some of the earlier ones since we are actually removing orphaned __exit functions and some ".remove" functions as well. So we can't claim binary equivalence here, but the overall runtime should remain unchanged. To that end, we have remained with the existing initcall levels even though some of the hotplug infrastructural ones might make better sense to be listed as subsys_initcall or similar. Build tested with allmodconfig on all the major architectures. Paul. --- Cc: Bharat Kumar Gogada Cc: Bjorn Helgaas Cc: Keith Busch Cc: Kishon Vijay Abraham I Cc: kristen.c.acca...@intel.com Cc: Marc Zyngier Cc: Michal Simek Cc: Mika Westerberg Cc: Scott Murray Cc: "Sören Brinkmann" Cc: Stanimir Varbanov Cc: Tom Long Nguyen Cc: linux-o...@vger.kernel.org Cc: linux-...@vger.kernel.org Paul Gortmaker (9): PCI: PCIe dpc: make it explicitly non-modular PCI: PCIe pme: make it explicitly non-modular PCI: PCIe aerdrv: make it explicitly non-modular PCI: dra7xx: make host code explicitly non-modular PCI: PCIe qcom: make host code explicitly non-modular PCI: PCIe xilinx: make host code explicitly non-modular PCI: PCIe xilinx-nwl: make host code explicitly non-modular PCI: hotplug_core: make it explicitly non-modular PCI: hotplug: make PCIe core code explicitly non-modular drivers/pci/host/pci-dra7xx.c | 31 ++- drivers/pci/host/pcie-qcom.c| 28 + drivers/pci/host/pcie-xilinx-nwl.c | 53 ++--- drivers/pci/host/pcie-xilinx.c | 53 ++--- drivers/pci/hotplug/cpci_hotplug.h | 2 -- drivers/pci/hotplug/cpci_hotplug_core.c | 10 --- drivers/pci/hotplug/pci_hotplug_core.c | 18 --- drivers/pci/hotplug/pciehp_core.c | 20 - drivers/pci/pcie/aer/aerdrv.c | 18 +-- drivers/pci/pcie/pcie-dpc.c | 18 +++ drivers/pci/pcie/pme.c | 16 +- 11 files changed, 32 insertions(+), 235 deletions(-) -- 2.8.4
[PATCH 9/9] PCI: hotplug: make PCIe core code explicitly non-modular
The Makefile fragments currently controlling compilation of this code are: obj-$(CONFIG_HOTPLUG_PCI_PCIE) += pciehp.o [...] pciehp-objs := pciehp_core.o \ The Kconfig currently controlling compilation of this code is: drivers/pci/pcie/Kconfig:config HOTPLUG_PCI_PCIE drivers/pci/pcie/Kconfig: bool "PCI Express Hotplug driver" ...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. However one could argue that we should use subsys_initcall() here, but for now we stick with runtime equivalence. We delete module.h but we keep the moduleparam.h include, since we are keeping the module_param() that the file has as-is for now. We also delete the MODULE_LICENSE tag etc since all that information is still contained higher up in the file via the DEFINE lines which now serve as documentation only. Cc: Bjorn Helgaas Cc: kristen.c.acca...@intel.com Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/hotplug/pciehp_core.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index ac531e674a05..fb0f86335158 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -27,7 +27,6 @@ * */ -#include #include #include #include @@ -47,10 +46,10 @@ static bool pciehp_force; #define DRIVER_AUTHOR "Dan Zink , Greg Kroah-Hartman , Dely Sy " #define DRIVER_DESC"PCI Express Hot Plug Controller Driver" -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); - +/* + * not really modular, but the easiest way to keep compat with existing + * bootargs behaviour is to continue using module_param here. + */ module_param(pciehp_debug, bool, 0644); module_param(pciehp_poll_mode, bool, 0644); module_param(pciehp_poll_time, int, 0644); @@ -337,13 +336,4 @@ static int __init pcied_init(void) return retval; } - -static void __exit pcied_cleanup(void) -{ - dbg("unload_pciehpd()\n"); - pcie_port_service_unregister(_portdrv); - info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); -} - -module_init(pcied_init); -module_exit(pcied_cleanup); +device_initcall(pcied_init); -- 2.8.4
[PATCH 6/9] PCI: PCIe xilinx: make host code explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_XILINX drivers/pci/host/Kconfig: bool "Xilinx AXI PCIe host bridge 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. This makes xilinx_pcie_free_irq_domain orphaned so we remove it too. We don't have to worry about disallowing a driver unbind, since this driver already does that. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Michal Simek <michal.si...@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkm...@xilinx.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pcie-xilinx.c | 53 ++ 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c index a30e01639557..7b7dbd22bccc 100644 --- a/drivers/pci/host/pcie-xilinx.c +++ b/drivers/pci/host/pcie-xilinx.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -506,35 +506,6 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data) } /** - * xilinx_pcie_free_irq_domain - Free IRQ domain - * @port: PCIe port information - */ -static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port) -{ - int i; - u32 irq, num_irqs; - - /* Free IRQ Domain */ - if (IS_ENABLED(CONFIG_PCI_MSI)) { - - free_pages(port->msi_pages, 0); - - num_irqs = XILINX_NUM_MSI_IRQS; - } else { - /* INTx */ - num_irqs = 4; - } - - for (i = 0; i < num_irqs; i++) { - irq = irq_find_mapping(port->irq_domain, i); - if (irq > 0) - irq_dispose_mapping(irq); - } - - irq_domain_remove(port->irq_domain); -} - -/** * xilinx_pcie_init_irq_domain - Initialize IRQ domain * @port: PCIe port information * @@ -724,21 +695,6 @@ error: return err; } -/** - * xilinx_pcie_remove - Remove function - * @pdev: Platform device pointer - * - * Return: '0' always - */ -static int xilinx_pcie_remove(struct platform_device *pdev) -{ - struct xilinx_pcie_port *port = platform_get_drvdata(pdev); - - xilinx_pcie_free_irq_domain(port); - - return 0; -} - static struct of_device_id xilinx_pcie_of_match[] = { { .compatible = "xlnx,axi-pcie-host-1.00.a", }, {} @@ -751,10 +707,5 @@ static struct platform_driver xilinx_pcie_driver = { .suppress_bind_attrs = true, }, .probe = xilinx_pcie_probe, - .remove = xilinx_pcie_remove, }; -module_platform_driver(xilinx_pcie_driver); - -MODULE_AUTHOR("Xilinx Inc"); -MODULE_DESCRIPTION("Xilinx AXI PCIe driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(xilinx_pcie_driver); -- 2.8.4
[PATCH 6/9] PCI: PCIe xilinx: make host code explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_XILINX drivers/pci/host/Kconfig: bool "Xilinx AXI PCIe host bridge 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. This makes xilinx_pcie_free_irq_domain orphaned so we remove it too. We don't have to worry about disallowing a driver unbind, since this driver already does that. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Bjorn Helgaas Cc: Michal Simek Cc: "Sören Brinkmann" Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pcie-xilinx.c | 53 ++ 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c index a30e01639557..7b7dbd22bccc 100644 --- a/drivers/pci/host/pcie-xilinx.c +++ b/drivers/pci/host/pcie-xilinx.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -506,35 +506,6 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data) } /** - * xilinx_pcie_free_irq_domain - Free IRQ domain - * @port: PCIe port information - */ -static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port) -{ - int i; - u32 irq, num_irqs; - - /* Free IRQ Domain */ - if (IS_ENABLED(CONFIG_PCI_MSI)) { - - free_pages(port->msi_pages, 0); - - num_irqs = XILINX_NUM_MSI_IRQS; - } else { - /* INTx */ - num_irqs = 4; - } - - for (i = 0; i < num_irqs; i++) { - irq = irq_find_mapping(port->irq_domain, i); - if (irq > 0) - irq_dispose_mapping(irq); - } - - irq_domain_remove(port->irq_domain); -} - -/** * xilinx_pcie_init_irq_domain - Initialize IRQ domain * @port: PCIe port information * @@ -724,21 +695,6 @@ error: return err; } -/** - * xilinx_pcie_remove - Remove function - * @pdev: Platform device pointer - * - * Return: '0' always - */ -static int xilinx_pcie_remove(struct platform_device *pdev) -{ - struct xilinx_pcie_port *port = platform_get_drvdata(pdev); - - xilinx_pcie_free_irq_domain(port); - - return 0; -} - static struct of_device_id xilinx_pcie_of_match[] = { { .compatible = "xlnx,axi-pcie-host-1.00.a", }, {} @@ -751,10 +707,5 @@ static struct platform_driver xilinx_pcie_driver = { .suppress_bind_attrs = true, }, .probe = xilinx_pcie_probe, - .remove = xilinx_pcie_remove, }; -module_platform_driver(xilinx_pcie_driver); - -MODULE_AUTHOR("Xilinx Inc"); -MODULE_DESCRIPTION("Xilinx AXI PCIe driver"); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(xilinx_pcie_driver); -- 2.8.4
[PATCH 0/6] pinctrl: trivial demodularization of builtin code
This list of changes represents pinctrl drivers that use MODULE_ tags but otherwise don't make use of any other module_ functions or macros. Since the former are no-ops when built-in, we simply remove these MODULE_ tags and the module.h include that provides them, while ensuring the information in the tag is properly represented in the file at the comments at the top or similar. Since these tags are no-ops, and we don't remove any orphaned fcns for __exit or .remove support here, the drivers are binary equivalent before and after this change -- i.e. zero runtime regression risk. Paul. --- Cc: Alessandro Rubini <rub...@unipv.it> Cc: Barry Song <bao...@kernel.org> Cc: Heiko Stuebner <he...@sntech.de> Cc: Hongzhou Yang <hongzhou.y...@mediatek.com> Cc: Linus Walleij <linus.wall...@linaro.org> Cc: Patrice Chotard <patrice.chot...@st.com> Cc: Rongjun Ying <rongjun.y...@csr.com> Cc: Yuping Luo <yuping@csr.com> Cc: linux-g...@vger.kernel.org Cc: linux-rockc...@lists.infradead.org Paul Gortmaker (6): pinctrl: mediatek: make mtk-common explicitly non-modular pinctrl: nomadik: make abx500 explicitly non-modular pinctrl: nomadik: make core support explicitly non-modular pinctrl: rockchip: make it explicitly non-modular pinctrl: sirf: make atlas7 explicitly non-modular pinctrl: sirf: make core support explicitly non-modular drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 5 - drivers/pinctrl/nomadik/pinctrl-abx500.c | 8 ++-- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 5 - drivers/pinctrl/pinctrl-rockchip.c| 7 +-- drivers/pinctrl/sirf/pinctrl-atlas7.c | 5 + drivers/pinctrl/sirf/pinctrl-sirf.c | 12 +--- 6 files changed, 9 insertions(+), 33 deletions(-) -- 2.8.4
[PATCH 0/6] pinctrl: trivial demodularization of builtin code
This list of changes represents pinctrl drivers that use MODULE_ tags but otherwise don't make use of any other module_ functions or macros. Since the former are no-ops when built-in, we simply remove these MODULE_ tags and the module.h include that provides them, while ensuring the information in the tag is properly represented in the file at the comments at the top or similar. Since these tags are no-ops, and we don't remove any orphaned fcns for __exit or .remove support here, the drivers are binary equivalent before and after this change -- i.e. zero runtime regression risk. Paul. --- Cc: Alessandro Rubini Cc: Barry Song Cc: Heiko Stuebner Cc: Hongzhou Yang Cc: Linus Walleij Cc: Patrice Chotard Cc: Rongjun Ying Cc: Yuping Luo Cc: linux-g...@vger.kernel.org Cc: linux-rockc...@lists.infradead.org Paul Gortmaker (6): pinctrl: mediatek: make mtk-common explicitly non-modular pinctrl: nomadik: make abx500 explicitly non-modular pinctrl: nomadik: make core support explicitly non-modular pinctrl: rockchip: make it explicitly non-modular pinctrl: sirf: make atlas7 explicitly non-modular pinctrl: sirf: make core support explicitly non-modular drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 5 - drivers/pinctrl/nomadik/pinctrl-abx500.c | 8 ++-- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 5 - drivers/pinctrl/pinctrl-rockchip.c| 7 +-- drivers/pinctrl/sirf/pinctrl-atlas7.c | 5 + drivers/pinctrl/sirf/pinctrl-sirf.c | 12 +--- 6 files changed, 9 insertions(+), 33 deletions(-) -- 2.8.4
[PATCH 5/6] pinctrl: sirf: make atlas7 explicitly non-modular
The Makefile currently controlling compilation of this code is: drivers/pinctrl/sirf/pinctrl-atlas7.o ---> drivers/pinctrl/sirf/Makefile:obj-y += pinctrl-atlas7.o ...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: Linus Walleij <linus.wall...@linaro.org> Cc: Barry Song <bao...@kernel.org> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pinctrl/sirf/pinctrl-atlas7.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c index 19952f73fa8c..7f3041697813 100644 --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c @@ -7,7 +7,7 @@ * Licensed under GPLv2 or later. */ -#include +#include #include #include #include @@ -6158,6 +6158,3 @@ static int __init atlas7_gpio_init(void) return platform_driver_register(_gpio_driver); } subsys_initcall(atlas7_gpio_init); - -MODULE_DESCRIPTION("SIRFSOC Atlas7 pin control driver"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 4/6] pinctrl: rockchip: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pinctrl/Kconfig:config PINCTRL_ROCKCHIP drivers/pinctrl/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. 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: Linus Walleij <linus.wall...@linaro.org> Cc: Heiko Stuebner <he...@sntech.de> Cc: linux-g...@vger.kernel.org Cc: linux-rockc...@lists.infradead.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pinctrl/pinctrl-rockchip.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 44902c63f507..49bf7dcb7ed8 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -23,7 +23,7 @@ * GNU General Public License for more details. */ -#include +#include #include #include #include @@ -2704,7 +2704,6 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = { .data = (void *)_pin_ctrl }, {}, }; -MODULE_DEVICE_TABLE(of, rockchip_pinctrl_dt_match); static struct platform_driver rockchip_pinctrl_driver = { .probe = rockchip_pinctrl_probe, @@ -2720,7 +2719,3 @@ static int __init rockchip_pinctrl_drv_register(void) return platform_driver_register(_pinctrl_driver); } postcore_initcall(rockchip_pinctrl_drv_register); - -MODULE_AUTHOR("Heiko Stuebner <he...@sntech.de>"); -MODULE_DESCRIPTION("Rockchip pinctrl driver"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 5/6] pinctrl: sirf: make atlas7 explicitly non-modular
The Makefile currently controlling compilation of this code is: drivers/pinctrl/sirf/pinctrl-atlas7.o ---> drivers/pinctrl/sirf/Makefile:obj-y += pinctrl-atlas7.o ...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: Linus Walleij Cc: Barry Song Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pinctrl/sirf/pinctrl-atlas7.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c index 19952f73fa8c..7f3041697813 100644 --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c @@ -7,7 +7,7 @@ * Licensed under GPLv2 or later. */ -#include +#include #include #include #include @@ -6158,6 +6158,3 @@ static int __init atlas7_gpio_init(void) return platform_driver_register(_gpio_driver); } subsys_initcall(atlas7_gpio_init); - -MODULE_DESCRIPTION("SIRFSOC Atlas7 pin control driver"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 4/6] pinctrl: rockchip: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pinctrl/Kconfig:config PINCTRL_ROCKCHIP drivers/pinctrl/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. 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: Linus Walleij Cc: Heiko Stuebner Cc: linux-g...@vger.kernel.org Cc: linux-rockc...@lists.infradead.org Signed-off-by: Paul Gortmaker --- drivers/pinctrl/pinctrl-rockchip.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 44902c63f507..49bf7dcb7ed8 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -23,7 +23,7 @@ * GNU General Public License for more details. */ -#include +#include #include #include #include @@ -2704,7 +2704,6 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = { .data = (void *)_pin_ctrl }, {}, }; -MODULE_DEVICE_TABLE(of, rockchip_pinctrl_dt_match); static struct platform_driver rockchip_pinctrl_driver = { .probe = rockchip_pinctrl_probe, @@ -2720,7 +2719,3 @@ static int __init rockchip_pinctrl_drv_register(void) return platform_driver_register(_pinctrl_driver); } postcore_initcall(rockchip_pinctrl_drv_register); - -MODULE_AUTHOR("Heiko Stuebner "); -MODULE_DESCRIPTION("Rockchip pinctrl driver"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 2/6] pinctrl: nomadik: make abx500 explicitly non-modular
The Kconfig currently controlling compilation of this code is: config PINCTRL_ABX500 bool "ST-Ericsson ABx500 family Mixed Signal Circuit gpio functions" ...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. Note that MODULE_ALIAS 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: Linus Walleij <linus.wall...@linaro.org> Cc: Alessandro Rubini <rub...@unipv.it> Cc: Patrice Chotard <patrice.chot...@st.com> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pinctrl/nomadik/pinctrl-abx500.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c index 7d343c22c90c..f95001bc1d58 100644 --- a/drivers/pinctrl/nomadik/pinctrl-abx500.c +++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c @@ -4,6 +4,8 @@ * Author: Patrice Chotard <patrice.chot...@st.com> * License terms: GNU General Public License (GPL) version 2 * + * Driver allows to use AxB5xx unused pins to be used as GPIO + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -12,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -1269,8 +1270,3 @@ static int __init abx500_gpio_init(void) return platform_driver_register(_gpio_driver); } core_initcall(abx500_gpio_init); - -MODULE_AUTHOR("Patrice Chotard <patrice.chot...@st.com>"); -MODULE_DESCRIPTION("Driver allows to use AxB5xx unused pins to be used as GPIO"); -MODULE_ALIAS("platform:abx500-gpio"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 6/6] pinctrl: sirf: make core support explicitly non-modular
The Makefile currently controlling compilation of this code is: drivers/pinctrl/sirf/pinctrl-sirf.o --> drivers/pinctrl/sirf/Makefile:obj-y += pinctrl-sirf.o ...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 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: Linus Walleij <linus.wall...@linaro.org> Cc: Rongjun Ying <rongjun.y...@csr.com> Cc: Yuping Luo <yuping@csr.com> Cc: Barry Song <bao...@kernel.org> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pinctrl/sirf/pinctrl-sirf.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c index 762c0c9c1278..0df72be60704 100644 --- a/drivers/pinctrl/sirf/pinctrl-sirf.c +++ b/drivers/pinctrl/sirf/pinctrl-sirf.c @@ -1,6 +1,11 @@ /* * pinmux driver for CSR SiRFprimaII * + * Authors: + * Rongjun Ying <rongjun.y...@csr.com> + * Yuping Luo <yuping@csr.com> + * Barry Song <baohua.s...@csr.com> + * * Copyright (c) 2011 - 2014 Cambridge Silicon Radio Limited, a CSR plc group * company. * @@ -8,7 +13,6 @@ */ #include -#include #include #include #include @@ -884,9 +888,3 @@ static int __init sirfsoc_gpio_init(void) return sirfsoc_gpio_probe(np); } subsys_initcall(sirfsoc_gpio_init); - -MODULE_AUTHOR("Rongjun Ying <rongjun.y...@csr.com>"); -MODULE_AUTHOR("Yuping Luo <yuping@csr.com>"); -MODULE_AUTHOR("Barry Song <baohua.s...@csr.com>"); -MODULE_DESCRIPTION("SIRFSOC pin control driver"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 2/6] pinctrl: nomadik: make abx500 explicitly non-modular
The Kconfig currently controlling compilation of this code is: config PINCTRL_ABX500 bool "ST-Ericsson ABx500 family Mixed Signal Circuit gpio functions" ...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. Note that MODULE_ALIAS 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: Linus Walleij Cc: Alessandro Rubini Cc: Patrice Chotard Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pinctrl/nomadik/pinctrl-abx500.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c index 7d343c22c90c..f95001bc1d58 100644 --- a/drivers/pinctrl/nomadik/pinctrl-abx500.c +++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c @@ -4,6 +4,8 @@ * Author: Patrice Chotard * License terms: GNU General Public License (GPL) version 2 * + * Driver allows to use AxB5xx unused pins to be used as GPIO + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -12,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -1269,8 +1270,3 @@ static int __init abx500_gpio_init(void) return platform_driver_register(_gpio_driver); } core_initcall(abx500_gpio_init); - -MODULE_AUTHOR("Patrice Chotard "); -MODULE_DESCRIPTION("Driver allows to use AxB5xx unused pins to be used as GPIO"); -MODULE_ALIAS("platform:abx500-gpio"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 6/6] pinctrl: sirf: make core support explicitly non-modular
The Makefile currently controlling compilation of this code is: drivers/pinctrl/sirf/pinctrl-sirf.o --> drivers/pinctrl/sirf/Makefile:obj-y += pinctrl-sirf.o ...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 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: Linus Walleij Cc: Rongjun Ying Cc: Yuping Luo Cc: Barry Song Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pinctrl/sirf/pinctrl-sirf.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c index 762c0c9c1278..0df72be60704 100644 --- a/drivers/pinctrl/sirf/pinctrl-sirf.c +++ b/drivers/pinctrl/sirf/pinctrl-sirf.c @@ -1,6 +1,11 @@ /* * pinmux driver for CSR SiRFprimaII * + * Authors: + * Rongjun Ying + * Yuping Luo + * Barry Song + * * Copyright (c) 2011 - 2014 Cambridge Silicon Radio Limited, a CSR plc group * company. * @@ -8,7 +13,6 @@ */ #include -#include #include #include #include @@ -884,9 +888,3 @@ static int __init sirfsoc_gpio_init(void) return sirfsoc_gpio_probe(np); } subsys_initcall(sirfsoc_gpio_init); - -MODULE_AUTHOR("Rongjun Ying "); -MODULE_AUTHOR("Yuping Luo "); -MODULE_AUTHOR("Barry Song "); -MODULE_DESCRIPTION("SIRFSOC pin control driver"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 1/6] pinctrl: mediatek: make mtk-common explicitly non-modular
The Makefile currently controlling compilation of this code is: drivers/pinctrl/mediatek/pinctrl-mtk-common.o ---> drivers/pinctrl/mediatek/Makefile:obj-y += pinctrl-mtk-common.o ...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 don't replace module.h with init.h since the file doesn't need that. Cc: Linus Walleij <linus.wall...@linaro.org> Cc: Hongzhou Yang <hongzhou.y...@mediatek.com> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index ce554e0d6979..ba2b03dbfe3b 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -1496,7 +1495,3 @@ chip_error: gpiochip_remove(pctl->chip); return ret; } - -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("MediaTek Pinctrl Driver"); -MODULE_AUTHOR("Hongzhou Yang <hongzhou.y...@mediatek.com>"); -- 2.8.4
[PATCH 3/6] pinctrl: nomadik: make core support explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pinctrl/nomadik/Kconfig:config PINCTRL_NOMADIK drivers/pinctrl/nomadik/Kconfig:bool "Nomadik pin controller driver" ...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: Linus Walleij <linus.wall...@linaro.org> Cc: Alessandro Rubini <rub...@unipv.it> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index 6f2e1da11b1e..205fb399268a 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -11,7 +11,6 @@ * published by the Free Software Foundation. */ #include -#include #include #include #include @@ -1983,7 +1982,3 @@ static int __init nmk_pinctrl_init(void) return platform_driver_register(_pinctrl_driver); } core_initcall(nmk_pinctrl_init); - -MODULE_AUTHOR("Prafulla WADASKAR and Alessandro Rubini"); -MODULE_DESCRIPTION("Nomadik GPIO Driver"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 1/6] pinctrl: mediatek: make mtk-common explicitly non-modular
The Makefile currently controlling compilation of this code is: drivers/pinctrl/mediatek/pinctrl-mtk-common.o ---> drivers/pinctrl/mediatek/Makefile:obj-y += pinctrl-mtk-common.o ...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 don't replace module.h with init.h since the file doesn't need that. Cc: Linus Walleij Cc: Hongzhou Yang Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index ce554e0d6979..ba2b03dbfe3b 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -1496,7 +1495,3 @@ chip_error: gpiochip_remove(pctl->chip); return ret; } - -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("MediaTek Pinctrl Driver"); -MODULE_AUTHOR("Hongzhou Yang "); -- 2.8.4
[PATCH 3/6] pinctrl: nomadik: make core support explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pinctrl/nomadik/Kconfig:config PINCTRL_NOMADIK drivers/pinctrl/nomadik/Kconfig:bool "Nomadik pin controller driver" ...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: Linus Walleij Cc: Alessandro Rubini Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index 6f2e1da11b1e..205fb399268a 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -11,7 +11,6 @@ * published by the Free Software Foundation. */ #include -#include #include #include #include @@ -1983,7 +1982,3 @@ static int __init nmk_pinctrl_init(void) return platform_driver_register(_pinctrl_driver); } core_initcall(nmk_pinctrl_init); - -MODULE_AUTHOR("Prafulla WADASKAR and Alessandro Rubini"); -MODULE_DESCRIPTION("Nomadik GPIO Driver"); -MODULE_LICENSE("GPL"); -- 2.8.4
Re: [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
On Fri, Aug 5, 2016 at 8:57 AM, Lee Jones <lee.jo...@linaro.org> wrote: > On Mon, 04 Jul 2016, Paul Gortmaker wrote: > >> The Kconfig currently controlling compilation of this code is: >> >> drivers/mfd/Kconfig:config MFD_ALTERA_A10SR >> drivers/mfd/Kconfig:bool "Altera Arria10 DevKit System Resource chip" >> >> ...meaning that it currently is not being built as a module by anyone. >> >> Lets remove the modular code that is essentially orphaned, so that >> when reading the driver there is no doubt it is builtin-only. >> [...] >> >> Cc: Thor Thayer <ttha...@opensource.altera.com> >> Cc: Lee Jones <lee.jo...@linaro.org> >> Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> >> --- >> 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. -- > >> diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c >> index c05aa4ff57fd..78c2fb7d7f33 100644 >> --- a/drivers/mfd/altera-a10sr.c >> +++ b/drivers/mfd/altera-a10sr.c >> @@ -1,4 +1,8 @@ >> /* >> + * Altera Arria10 DevKit System Resource MFD Driver >> + * >> + * Author: Thor Thayer <ttha...@opensource.altera.com> >> + * >> * Copyright Intel Corporation (C) 2014-2016. All Rights Reserved >> * >> * This program is free software; you can redistribute it and/or modify it >> @@ -20,7 +24,7 @@ >> >> #include >> #include >> -#include >> +#include >> #include >> #include >> >> @@ -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 <ttha...@opensource.altera.com>"); >> -MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver"); >> +builtin_driver(altr_a10sr_spi_driver, spi_register_driver) > > -- > Lee Jones > Linaro STMicroelectronics Landing Team Lead > Linaro.org │ Open source software for ARM SoCs > Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH 1/6] mfd: altera-a10sr: make it explicitly non-modular
On Fri, Aug 5, 2016 at 8:57 AM, Lee Jones wrote: > On Mon, 04 Jul 2016, Paul Gortmaker wrote: > >> The Kconfig currently controlling compilation of this code is: >> >> drivers/mfd/Kconfig:config MFD_ALTERA_A10SR >> drivers/mfd/Kconfig:bool "Altera Arria10 DevKit System Resource chip" >> >> ...meaning that it currently is not being built as a module by anyone. >> >> Lets remove the modular code that is essentially orphaned, so that >> when reading the driver there is no doubt it is builtin-only. >> [...] >> >> Cc: Thor Thayer >> Cc: Lee Jones >> Signed-off-by: Paul Gortmaker >> --- >> 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. -- > >> diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c >> index c05aa4ff57fd..78c2fb7d7f33 100644 >> --- a/drivers/mfd/altera-a10sr.c >> +++ b/drivers/mfd/altera-a10sr.c >> @@ -1,4 +1,8 @@ >> /* >> + * Altera Arria10 DevKit System Resource MFD Driver >> + * >> + * Author: Thor Thayer >> + * >> * 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 >> #include >> -#include >> +#include >> #include >> #include >> >> @@ -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 "); >> -MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver"); >> +builtin_driver(altr_a10sr_spi_driver, spi_register_driver) > > -- > Lee Jones > Linaro STMicroelectronics Landing Team Lead > Linaro.org │ Open source software for ARM SoCs > Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH -next] ARM: pxa: remove duplicated include from spitz.c
[Re: [PATCH -next] ARM: pxa: remove duplicated include from spitz.c] On 23/08/2016 (Tue 19:20) Robert Jarzmik wrote: > Wei Yongjunwrites: > > > Hi Robert, > > On 08/24/2016 12:24 AM, Robert Jarzmik wrote: > >> Wei Yongjun writes: > >> > >>> Remove duplicated include. > >> How so duplicated ? Can you elaborate please ? > >> > >> Moreover, how do you do think symbol_get() can stay in spitz.c without > >> having > >> this include ? > > > > file linux/module.h included twice as following: > > > > #include > > #include/* symbol_get ; symbol_put */ > > ... > > #include > > > > So I think we can remove the dup include. > > Ah I see it now. > > What you really mean is that you want to revert 12beb346710b ("Merge tag > 'pxa-fixes-v4.8' of https://github.com/rjarzmik/linux into randconfig-4.8"), > because : > - I wasn't carefull enough at review time of > > https://github.com/rjarzmik/linux/commit/5351ca4e70f30e0175265fbf98691528b9a4e990 > > https://github.com/rjarzmik/linux/commit/a3c747b96df66a7eb810fef45f3b9e65614712d9 > > - and because Paul wasn't very carefull when we look at : >73017a542fd2 ("arm: fix implicit module.h users by adding it to arch/arm as >required.") > > So all in all, I'd prefer a revert with Paul's ack please. So if possible, please drop the duplicate module.h w/o the comment vs. a revert. Since it appeared as a pseudo merge and was not my original commit anyway, this shouldn't be a problem I hope... You can call it careless if you want, I won't be offended -- FWIW I was juggling several different streams; one to audit and remove apparently non-required inclusions of module.h and one to unwind the implicit gpio inclusion presence before trying to pave the way to fixing _that_ last minute for 4.8; it was mixing and testing the two simulatenously that led to the removal and re-addition; which when separating out the latter caused it to become a duplicate additon as reported above. Not an excuse; just one of those happenstance corner cases. I'd since fixed the dup locally and added this to my automated testing: make includecheck |sort > /tmp/pre-include.txt <...apply all WIP patches> make includecheck |sort > /tmp/post-include.txt diff -u /tmp/pre-include.txt /tmp/post-include.txt > /tmp/inc-delta.txt if [ -s /tmp/inc-delta.txt ]; then echo redundant includes changed. cat /tmp/inc-delta.txt fi > And this time I'll go through my pxa/for-next tree, I was a fool to > put that in pxa/fixes. Well, you were not a fool - the fault is mine if it belongs to anyone. You made a sensible call based on what I wrote in the commit log. Fortunately it is 100% harmless and if you want to clean it up locally and do so ASAP, then no problem -- do it and consider it Ack'd. Thanks, Paul. -- > > Cheers. > > -- Robert
Re: [PATCH -next] ARM: pxa: remove duplicated include from spitz.c
[Re: [PATCH -next] ARM: pxa: remove duplicated include from spitz.c] On 23/08/2016 (Tue 19:20) Robert Jarzmik wrote: > Wei Yongjun writes: > > > Hi Robert, > > On 08/24/2016 12:24 AM, Robert Jarzmik wrote: > >> Wei Yongjun writes: > >> > >>> Remove duplicated include. > >> How so duplicated ? Can you elaborate please ? > >> > >> Moreover, how do you do think symbol_get() can stay in spitz.c without > >> having > >> this include ? > > > > file linux/module.h included twice as following: > > > > #include > > #include/* symbol_get ; symbol_put */ > > ... > > #include > > > > So I think we can remove the dup include. > > Ah I see it now. > > What you really mean is that you want to revert 12beb346710b ("Merge tag > 'pxa-fixes-v4.8' of https://github.com/rjarzmik/linux into randconfig-4.8"), > because : > - I wasn't carefull enough at review time of > > https://github.com/rjarzmik/linux/commit/5351ca4e70f30e0175265fbf98691528b9a4e990 > > https://github.com/rjarzmik/linux/commit/a3c747b96df66a7eb810fef45f3b9e65614712d9 > > - and because Paul wasn't very carefull when we look at : >73017a542fd2 ("arm: fix implicit module.h users by adding it to arch/arm as >required.") > > So all in all, I'd prefer a revert with Paul's ack please. So if possible, please drop the duplicate module.h w/o the comment vs. a revert. Since it appeared as a pseudo merge and was not my original commit anyway, this shouldn't be a problem I hope... You can call it careless if you want, I won't be offended -- FWIW I was juggling several different streams; one to audit and remove apparently non-required inclusions of module.h and one to unwind the implicit gpio inclusion presence before trying to pave the way to fixing _that_ last minute for 4.8; it was mixing and testing the two simulatenously that led to the removal and re-addition; which when separating out the latter caused it to become a duplicate additon as reported above. Not an excuse; just one of those happenstance corner cases. I'd since fixed the dup locally and added this to my automated testing: make includecheck |sort > /tmp/pre-include.txt <...apply all WIP patches> make includecheck |sort > /tmp/post-include.txt diff -u /tmp/pre-include.txt /tmp/post-include.txt > /tmp/inc-delta.txt if [ -s /tmp/inc-delta.txt ]; then echo redundant includes changed. cat /tmp/inc-delta.txt fi > And this time I'll go through my pxa/for-next tree, I was a fool to > put that in pxa/fixes. Well, you were not a fool - the fault is mine if it belongs to anyone. You made a sensible call based on what I wrote in the commit log. Fortunately it is 100% harmless and if you want to clean it up locally and do so ASAP, then no problem -- do it and consider it Ack'd. Thanks, Paul. -- > > Cheers. > > -- Robert
Re: [PATCH -next] PCI/PCIe: make DPC explicitly non-modular
[Re: [PATCH -next] PCI/PCIe: make DPC explicitly non-modular] On 22/08/2016 (Mon 14:44) Bjorn Helgaas wrote: > Hi Paul, > > On Thu, Jul 28, 2016 at 05:28:02PM -0400, Paul Gortmaker wrote: [...] > > > > Yep, not to worry, I've still got the following patches pending for-4.9: > > > > $ grep PCI series > > # PCI > > PCI-aerdrv-make-it-explicitly-non-modular.patch > > PCI-altera-make-it-explicitly-non-modular.patch > > PCI-dra7xx-make-it-explicitly-non-modular.patch > > PCI-imx6-make-it-explicitly-non-modular.patch > > PCI-pme-make-it-explicitly-non-modular.patch > > PCI-qcom-make-it-explicitly-non-modular.patch > > PCI-spear13xx-make-it-explicitly-non-modular.patch > > PCI-xilinx-make-it-explicitly-non-modular.patch > > PCI-xilinx-nwl-make-it-eplicitly-non-modular.patch > > PCI-portdrv-make-it-explicitly-non-modular.patch > > PCI-PCIe-make-dpc-explicitly-non-modular.patch > > PCI-generic-make-host-common-explicitly-non-modular.patch > > PCI-hotplug_core-make-it-explicitly-non-modular.patch > > PCI-hotplug-make-core-code-explicitly-non-modular.patch > > Were you planning to post the patches above? If so, I'll bundle them > all up along with this DPC one. Ha, too funny; I'd just split the remaining patches into two lots and sent lot #1 (the binary equivalent ones) before seeing this. The DPC one got put in lot #2 since it had __exit and/or .remove functions, so the change isn't strictly binary equivalent anymore. I'll send along lot #2 once you've had a chance to digest lot #1. So feel free to ignore the earlier copy of the DPC one. Thanks, Paul. -- > > Bjorn
Re: [PATCH -next] PCI/PCIe: make DPC explicitly non-modular
[Re: [PATCH -next] PCI/PCIe: make DPC explicitly non-modular] On 22/08/2016 (Mon 14:44) Bjorn Helgaas wrote: > Hi Paul, > > On Thu, Jul 28, 2016 at 05:28:02PM -0400, Paul Gortmaker wrote: [...] > > > > Yep, not to worry, I've still got the following patches pending for-4.9: > > > > $ grep PCI series > > # PCI > > PCI-aerdrv-make-it-explicitly-non-modular.patch > > PCI-altera-make-it-explicitly-non-modular.patch > > PCI-dra7xx-make-it-explicitly-non-modular.patch > > PCI-imx6-make-it-explicitly-non-modular.patch > > PCI-pme-make-it-explicitly-non-modular.patch > > PCI-qcom-make-it-explicitly-non-modular.patch > > PCI-spear13xx-make-it-explicitly-non-modular.patch > > PCI-xilinx-make-it-explicitly-non-modular.patch > > PCI-xilinx-nwl-make-it-eplicitly-non-modular.patch > > PCI-portdrv-make-it-explicitly-non-modular.patch > > PCI-PCIe-make-dpc-explicitly-non-modular.patch > > PCI-generic-make-host-common-explicitly-non-modular.patch > > PCI-hotplug_core-make-it-explicitly-non-modular.patch > > PCI-hotplug-make-core-code-explicitly-non-modular.patch > > Were you planning to post the patches above? If so, I'll bundle them > all up along with this DPC one. Ha, too funny; I'd just split the remaining patches into two lots and sent lot #1 (the binary equivalent ones) before seeing this. The DPC one got put in lot #2 since it had __exit and/or .remove functions, so the change isn't strictly binary equivalent anymore. I'll send along lot #2 once you've had a chance to digest lot #1. So feel free to ignore the earlier copy of the DPC one. Thanks, Paul. -- > > Bjorn
[PATCH 4/8] PCI: portdrv: make it explicitly non-modular
The Makefile/Kconfig currently controlling compilation of this code is: pcieportdrv-y := portdrv_core.o portdrv_pci.o portdrv_bus.o obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o drivers/pci/pcie/Kconfig:config PCIEPORTBUS drivers/pci/pcie/Kconfig: bool "PCI Express Port Bus 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 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 earlier up in the file. Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Tom Long Nguyen <tom.l.ngu...@intel.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/pcie/portdrv_pci.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 70d7ad8c6d17..85f7afcd6227 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -6,7 +6,6 @@ * Copyright (C) Tom Long Nguyen (tom.l.ngu...@intel.com) */ -#include #include #include #include @@ -27,9 +26,6 @@ #define DRIVER_VERSION "v1.0" #define DRIVER_AUTHOR "tom.l.ngu...@intel.com" #define DRIVER_DESC "PCIe Port Bus Driver" -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); /* If this switch is set, PCIe port native services should not be enabled. */ bool pcie_ports_disabled; @@ -341,7 +337,6 @@ static const struct pci_device_id port_pci_ids[] = { { PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0), }, { /* end: all zeroes */ } }; -MODULE_DEVICE_TABLE(pci, port_pci_ids); static const struct pci_error_handlers pcie_portdrv_err_handler = { .error_detected = pcie_portdrv_error_detected, @@ -406,5 +401,4 @@ static int __init pcie_portdrv_init(void) out: return retval; } - -module_init(pcie_portdrv_init); +device_initcall(pcie_portdrv_init); -- 2.8.4
[PATCH 2/8] PCI: altera: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_ALTERA drivers/pci/host/Kconfig: bool "Altera PCIe controller" ...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. 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: Ley Foon Tan <lf...@altera.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: r...@lists.rocketboards.org Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pcie-altera.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c index 2b7837650db8..48f2736a10cd 100644 --- a/drivers/pci/host/pcie-altera.c +++ b/drivers/pci/host/pcie-altera.c @@ -1,6 +1,9 @@ /* * Copyright Altera Corporation (C) 2013-2015. All rights reserved * + * Author: Ley Foon Tan <lf...@altera.com> + * Description: Altera PCIe host controller driver + * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. @@ -17,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -568,7 +571,6 @@ static const struct of_device_id altera_pcie_of_match[] = { { .compatible = "altr,pcie-root-port-1.0", }, {}, }; -MODULE_DEVICE_TABLE(of, altera_pcie_of_match); static struct platform_driver altera_pcie_driver = { .probe = altera_pcie_probe, @@ -583,8 +585,4 @@ static int altera_pcie_init(void) { return platform_driver_register(_pcie_driver); } -module_init(altera_pcie_init); - -MODULE_AUTHOR("Ley Foon Tan <lf...@altera.com>"); -MODULE_DESCRIPTION("Altera PCIe host controller driver"); -MODULE_LICENSE("GPL v2"); +device_initcall(altera_pcie_init); -- 2.8.4
[PATCH 7/8] PCI: exynos: make host support explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCI_EXYNOS drivers/pci/host/Kconfig: bool "Samsung Exynos PCIe controller" ...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. 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: Jingoo Han <jingooh...@gmail.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Kukjin Kim <kg...@kernel.org> Cc: Krzysztof Kozlowski <k.kozlow...@samsung.com> Cc: linux-...@vger.kernel.org Cc: linux-samsung-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pci-exynos.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c index 219976103efc..c3ae9c7a6e33 100644 --- a/drivers/pci/host/pci-exynos.c +++ b/drivers/pci/host/pci-exynos.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -624,7 +624,6 @@ static const struct of_device_id exynos_pcie_of_match[] = { { .compatible = "samsung,exynos5440-pcie", }, {}, }; -MODULE_DEVICE_TABLE(of, exynos_pcie_of_match); static struct platform_driver exynos_pcie_driver = { .remove = __exit_p(exynos_pcie_remove), @@ -641,7 +640,3 @@ static int __init exynos_pcie_init(void) return platform_driver_probe(_pcie_driver, exynos_pcie_probe); } subsys_initcall(exynos_pcie_init); - -MODULE_AUTHOR("Jingoo Han <jg1@samsung.com>"); -MODULE_DESCRIPTION("Samsung PCIe host controller driver"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 6/8] PCI: designware: make host support explicitly non-modular
The Kconfig entry controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_DW drivers/pci/host/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. We don't end up adding init.h to this file, since it isn't actually using __init or any initcalls directly. Cc: Jingoo Han <jingooh...@gmail.com> Cc: Pratyush Anand <pratyush.an...@gmail.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pcie-designware.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 12afce19890b..16374202cb8b 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -802,7 +801,3 @@ void dw_pcie_setup_rc(struct pcie_port *pp) val |= PORT_LOGIC_SPEED_CHANGE; dw_pcie_wr_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, val); } - -MODULE_AUTHOR("Jingoo Han <jg1@samsung.com>"); -MODULE_DESCRIPTION("Designware PCIe host controller driver"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 4/8] PCI: portdrv: make it explicitly non-modular
The Makefile/Kconfig currently controlling compilation of this code is: pcieportdrv-y := portdrv_core.o portdrv_pci.o portdrv_bus.o obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o drivers/pci/pcie/Kconfig:config PCIEPORTBUS drivers/pci/pcie/Kconfig: bool "PCI Express Port Bus 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 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 earlier up in the file. Cc: Bjorn Helgaas Cc: Tom Long Nguyen Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/pcie/portdrv_pci.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 70d7ad8c6d17..85f7afcd6227 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -6,7 +6,6 @@ * Copyright (C) Tom Long Nguyen (tom.l.ngu...@intel.com) */ -#include #include #include #include @@ -27,9 +26,6 @@ #define DRIVER_VERSION "v1.0" #define DRIVER_AUTHOR "tom.l.ngu...@intel.com" #define DRIVER_DESC "PCIe Port Bus Driver" -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); /* If this switch is set, PCIe port native services should not be enabled. */ bool pcie_ports_disabled; @@ -341,7 +337,6 @@ static const struct pci_device_id port_pci_ids[] = { { PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0), }, { /* end: all zeroes */ } }; -MODULE_DEVICE_TABLE(pci, port_pci_ids); static const struct pci_error_handlers pcie_portdrv_err_handler = { .error_detected = pcie_portdrv_error_detected, @@ -406,5 +401,4 @@ static int __init pcie_portdrv_init(void) out: return retval; } - -module_init(pcie_portdrv_init); +device_initcall(pcie_portdrv_init); -- 2.8.4
[PATCH 2/8] PCI: altera: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_ALTERA drivers/pci/host/Kconfig: bool "Altera PCIe controller" ...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. 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: Ley Foon Tan Cc: Bjorn Helgaas Cc: r...@lists.rocketboards.org Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pcie-altera.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c index 2b7837650db8..48f2736a10cd 100644 --- a/drivers/pci/host/pcie-altera.c +++ b/drivers/pci/host/pcie-altera.c @@ -1,6 +1,9 @@ /* * Copyright Altera Corporation (C) 2013-2015. All rights reserved * + * Author: Ley Foon Tan + * Description: Altera PCIe host controller driver + * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. @@ -17,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -568,7 +571,6 @@ static const struct of_device_id altera_pcie_of_match[] = { { .compatible = "altr,pcie-root-port-1.0", }, {}, }; -MODULE_DEVICE_TABLE(of, altera_pcie_of_match); static struct platform_driver altera_pcie_driver = { .probe = altera_pcie_probe, @@ -583,8 +585,4 @@ static int altera_pcie_init(void) { return platform_driver_register(_pcie_driver); } -module_init(altera_pcie_init); - -MODULE_AUTHOR("Ley Foon Tan "); -MODULE_DESCRIPTION("Altera PCIe host controller driver"); -MODULE_LICENSE("GPL v2"); +device_initcall(altera_pcie_init); -- 2.8.4
[PATCH 7/8] PCI: exynos: make host support explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCI_EXYNOS drivers/pci/host/Kconfig: bool "Samsung Exynos PCIe controller" ...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. 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: Jingoo Han Cc: Bjorn Helgaas Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-...@vger.kernel.org Cc: linux-samsung-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pci-exynos.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c index 219976103efc..c3ae9c7a6e33 100644 --- a/drivers/pci/host/pci-exynos.c +++ b/drivers/pci/host/pci-exynos.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -624,7 +624,6 @@ static const struct of_device_id exynos_pcie_of_match[] = { { .compatible = "samsung,exynos5440-pcie", }, {}, }; -MODULE_DEVICE_TABLE(of, exynos_pcie_of_match); static struct platform_driver exynos_pcie_driver = { .remove = __exit_p(exynos_pcie_remove), @@ -641,7 +640,3 @@ static int __init exynos_pcie_init(void) return platform_driver_probe(_pcie_driver, exynos_pcie_probe); } subsys_initcall(exynos_pcie_init); - -MODULE_AUTHOR("Jingoo Han "); -MODULE_DESCRIPTION("Samsung PCIe host controller driver"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 6/8] PCI: designware: make host support explicitly non-modular
The Kconfig entry controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_DW drivers/pci/host/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. We don't end up adding init.h to this file, since it isn't actually using __init or any initcalls directly. Cc: Jingoo Han Cc: Pratyush Anand Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pcie-designware.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 12afce19890b..16374202cb8b 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -802,7 +801,3 @@ void dw_pcie_setup_rc(struct pcie_port *pp) val |= PORT_LOGIC_SPEED_CHANGE; dw_pcie_wr_own_conf(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, 4, val); } - -MODULE_AUTHOR("Jingoo Han "); -MODULE_DESCRIPTION("Designware PCIe host controller driver"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 8/8] PCI: generic: make host-common explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCI_HOST_COMMON drivers/pci/host/Kconfig: bool ...meaning that it currently is not being built as a module by anyone. Lets remove the couple trivial modular references, so that when reading the code there is no doubt it is builtin-only. There are no modular init calls in this code, so no init ordering issues to be concerned with here. We don't replace module.h with init.h since the file does not have any functions marked with the __init prefix. We 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: Will Deacon <will.dea...@arm.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pci-host-common.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pci/host/pci-host-common.c b/drivers/pci/host/pci-host-common.c index 9d9d34e959b6..946382fd4ea1 100644 --- a/drivers/pci/host/pci-host-common.c +++ b/drivers/pci/host/pci-host-common.c @@ -1,4 +1,6 @@ /* + * Generic PCI host driver common code + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -17,7 +19,6 @@ */ #include -#include #include #include #include @@ -162,7 +163,3 @@ int pci_host_common_probe(struct platform_device *pdev, pci_bus_add_devices(bus); return 0; } - -MODULE_DESCRIPTION("Generic PCI host driver common code"); -MODULE_AUTHOR("Will Deacon <will.dea...@arm.com>"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 8/8] PCI: generic: make host-common explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCI_HOST_COMMON drivers/pci/host/Kconfig: bool ...meaning that it currently is not being built as a module by anyone. Lets remove the couple trivial modular references, so that when reading the code there is no doubt it is builtin-only. There are no modular init calls in this code, so no init ordering issues to be concerned with here. We don't replace module.h with init.h since the file does not have any functions marked with the __init prefix. We 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: Will Deacon Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pci-host-common.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pci/host/pci-host-common.c b/drivers/pci/host/pci-host-common.c index 9d9d34e959b6..946382fd4ea1 100644 --- a/drivers/pci/host/pci-host-common.c +++ b/drivers/pci/host/pci-host-common.c @@ -1,4 +1,6 @@ /* + * Generic PCI host driver common code + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. @@ -17,7 +19,6 @@ */ #include -#include #include #include #include @@ -162,7 +163,3 @@ int pci_host_common_probe(struct platform_device *pdev, pci_bus_add_devices(bus); return 0; } - -MODULE_DESCRIPTION("Generic PCI host driver common code"); -MODULE_AUTHOR("Will Deacon "); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 3/8] PCI: imx6: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCI_IMX6 drivers/pci/host/Kconfig: bool "Freescale i.MX6 PCIe controller" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple instances of modular code usage, 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. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We don't delete module.h since the file never even had that. 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: Richard Zhu <richard@freescale.com> Cc: Lucas Stach <l.st...@pengutronix.de> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pci-imx6.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index b741a36a67f3..ead4a5c3480b 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -739,7 +739,6 @@ static const struct of_device_id imx6_pcie_of_match[] = { { .compatible = "fsl,imx6qp-pcie", .data = (void *)IMX6QP, }, {}, }; -MODULE_DEVICE_TABLE(of, imx6_pcie_of_match); static struct platform_driver imx6_pcie_driver = { .driver = { @@ -749,14 +748,8 @@ static struct platform_driver imx6_pcie_driver = { .shutdown = imx6_pcie_shutdown, }; -/* Freescale PCIe driver does not allow module unload */ - static int __init imx6_pcie_init(void) { return platform_driver_probe(_pcie_driver, imx6_pcie_probe); } -module_init(imx6_pcie_init); - -MODULE_AUTHOR("Sean Cross <x...@kosagi.com>"); -MODULE_DESCRIPTION("Freescale i.MX6 PCIe host controller driver"); -MODULE_LICENSE("GPL v2"); +device_initcall(imx6_pcie_init); -- 2.8.4
[PATCH 3/8] PCI: imx6: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCI_IMX6 drivers/pci/host/Kconfig: bool "Freescale i.MX6 PCIe controller" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple instances of modular code usage, 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. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We don't delete module.h since the file never even had that. 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: Richard Zhu Cc: Lucas Stach Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pci-imx6.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index b741a36a67f3..ead4a5c3480b 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -739,7 +739,6 @@ static const struct of_device_id imx6_pcie_of_match[] = { { .compatible = "fsl,imx6qp-pcie", .data = (void *)IMX6QP, }, {}, }; -MODULE_DEVICE_TABLE(of, imx6_pcie_of_match); static struct platform_driver imx6_pcie_driver = { .driver = { @@ -749,14 +748,8 @@ static struct platform_driver imx6_pcie_driver = { .shutdown = imx6_pcie_shutdown, }; -/* Freescale PCIe driver does not allow module unload */ - static int __init imx6_pcie_init(void) { return platform_driver_probe(_pcie_driver, imx6_pcie_probe); } -module_init(imx6_pcie_init); - -MODULE_AUTHOR("Sean Cross "); -MODULE_DESCRIPTION("Freescale i.MX6 PCIe host controller driver"); -MODULE_LICENSE("GPL v2"); +device_initcall(imx6_pcie_init); -- 2.8.4
[PATCH 5/8] PCI: spear13xx: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_SPEAR13XX drivers/pci/host/Kconfig: bool "STMicroelectronics SPEAr PCIe controller" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple instances of modular code usage, 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. 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: Pratyush Anand <pratyush.an...@gmail.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pcie-spear13xx.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c index a4060b85ab23..09aed85f275a 100644 --- a/drivers/pci/host/pcie-spear13xx.c +++ b/drivers/pci/host/pcie-spear13xx.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -355,7 +355,6 @@ static const struct of_device_id spear13xx_pcie_of_match[] = { { .compatible = "st,spear1340-pcie", }, {}, }; -MODULE_DEVICE_TABLE(of, spear13xx_pcie_of_match); static struct platform_driver spear13xx_pcie_driver = { .probe = spear13xx_pcie_probe, @@ -365,14 +364,8 @@ static struct platform_driver spear13xx_pcie_driver = { }, }; -/* SPEAr13xx PCIe driver does not allow module unload */ - static int __init spear13xx_pcie_init(void) { return platform_driver_register(_pcie_driver); } -module_init(spear13xx_pcie_init); - -MODULE_DESCRIPTION("ST Microelectronics SPEAr13xx PCIe host controller driver"); -MODULE_AUTHOR("Pratyush Anand <pratyush.an...@gmail.com>"); -MODULE_LICENSE("GPL v2"); +device_initcall(spear13xx_pcie_init); -- 2.8.4
[PATCH 5/8] PCI: spear13xx: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_SPEAR13XX drivers/pci/host/Kconfig: bool "STMicroelectronics SPEAr PCIe controller" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple instances of modular code usage, 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. 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: Pratyush Anand Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pcie-spear13xx.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c index a4060b85ab23..09aed85f275a 100644 --- a/drivers/pci/host/pcie-spear13xx.c +++ b/drivers/pci/host/pcie-spear13xx.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -355,7 +355,6 @@ static const struct of_device_id spear13xx_pcie_of_match[] = { { .compatible = "st,spear1340-pcie", }, {}, }; -MODULE_DEVICE_TABLE(of, spear13xx_pcie_of_match); static struct platform_driver spear13xx_pcie_driver = { .probe = spear13xx_pcie_probe, @@ -365,14 +364,8 @@ static struct platform_driver spear13xx_pcie_driver = { }, }; -/* SPEAr13xx PCIe driver does not allow module unload */ - static int __init spear13xx_pcie_init(void) { return platform_driver_register(_pcie_driver); } -module_init(spear13xx_pcie_init); - -MODULE_DESCRIPTION("ST Microelectronics SPEAr13xx PCIe host controller driver"); -MODULE_AUTHOR("Pratyush Anand "); -MODULE_LICENSE("GPL v2"); +device_initcall(spear13xx_pcie_init); -- 2.8.4
[PATCH 0/8] PCI: more trivial demodularization of builtin code
This is another group of commits that was chosen since they really don't change anything even at a binary object file level ; they just replace module_init with device_initcall (which are identical), and remove some MODULE_ tags that are no-ops in code. So the run time regression risk is zero here. More specifically, we are doing the following to these PCI files that currently can only be built-in: -- remove the include of module.h ; replace it with init.h as req'd -- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in. -- replace module_init (if present) with device_initcall, which is functionally identical once CPP has processed the source. -- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION while ensuring the contained info is present in the file comments. Build tested for allmodconfig on several arch, including ARM and ARM-64 on a recent linux-next baseline. Some non-modular PCI files still remain with unused __exit and/or .remove functions. Those will be dealt with in a separate series after this. Also note that we looked into modularizing some of the PCI_DW stuff at an earlier time[1] but that ran into problems such as trying to create unwind for hook_fault_code etc. that wasn't easily solved. So we just go with keeping the code runtime functionally equivalent to what it was. Paul. [1] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortma...@windriver.com --- Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Jingoo Han <jingooh...@gmail.com> Cc: Krzysztof Kozlowski <k.kozlow...@samsung.com> Cc: Kukjin Kim <kg...@kernel.org> Cc: Ley Foon Tan <lf...@altera.com> Cc: Lucas Stach <l.st...@pengutronix.de> Cc: Pratyush Anand <pratyush.an...@gmail.com> Cc: Richard Zhu <richard@freescale.com> Cc: Tom Long Nguyen <tom.l.ngu...@intel.com> Cc: Will Deacon <will.dea...@arm.com> Cc: r...@lists.rocketboards.org Cc: linux-...@vger.kernel.org Cc: linux-samsung-...@vger.kernel.org Paul Gortmaker (8): PCI: altera: make msi explicitly non-modular PCI: altera: make it explicitly non-modular PCI: imx6: make it explicitly non-modular PCI: portdrv: make it explicitly non-modular PCI: spear13xx: make it explicitly non-modular PCI: designware: make host support explicitly non-modular PCI: exynos: make host support explicitly non-modular PCI: generic: make host-common explicitly non-modular drivers/pci/host/pci-exynos.c | 7 +-- drivers/pci/host/pci-host-common.c | 7 ++- drivers/pci/host/pci-imx6.c| 9 + drivers/pci/host/pcie-altera-msi.c | 10 +- drivers/pci/host/pcie-altera.c | 12 +--- drivers/pci/host/pcie-designware.c | 5 - drivers/pci/host/pcie-spear13xx.c | 11 ++- drivers/pci/pcie/portdrv_pci.c | 8 +--- 8 files changed, 17 insertions(+), 52 deletions(-) -- 2.8.4
[PATCH 1/8] PCI: altera: make msi explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_ALTERA_MSI drivers/pci/host/Kconfig: bool "Altera PCIe MSI feature" ...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 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: Ley Foon Tan <lf...@altera.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: r...@lists.rocketboards.org Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/pci/host/pcie-altera-msi.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pci/host/pcie-altera-msi.c b/drivers/pci/host/pcie-altera-msi.c index 99177f4ccde2..369e033449c6 100644 --- a/drivers/pci/host/pcie-altera-msi.c +++ b/drivers/pci/host/pcie-altera-msi.c @@ -1,4 +1,8 @@ /* + * Altera PCIe MSI support + * + * Author: Ley Foon Tan <lf...@altera.com> + * * Copyright Altera Corporation (C) 2013-2015. All rights reserved * * This program is free software; you can redistribute it and/or modify it @@ -16,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -308,7 +312,3 @@ static int __init altera_msi_init(void) return platform_driver_register(_msi_driver); } subsys_initcall(altera_msi_init); - -MODULE_AUTHOR("Ley Foon Tan <lf...@altera.com>"); -MODULE_DESCRIPTION("Altera PCIe MSI support"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 1/8] PCI: altera: make msi explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/pci/host/Kconfig:config PCIE_ALTERA_MSI drivers/pci/host/Kconfig: bool "Altera PCIe MSI feature" ...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 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: Ley Foon Tan Cc: Bjorn Helgaas Cc: r...@lists.rocketboards.org Cc: linux-...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/pci/host/pcie-altera-msi.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pci/host/pcie-altera-msi.c b/drivers/pci/host/pcie-altera-msi.c index 99177f4ccde2..369e033449c6 100644 --- a/drivers/pci/host/pcie-altera-msi.c +++ b/drivers/pci/host/pcie-altera-msi.c @@ -1,4 +1,8 @@ /* + * Altera PCIe MSI support + * + * Author: Ley Foon Tan + * * Copyright Altera Corporation (C) 2013-2015. All rights reserved * * This program is free software; you can redistribute it and/or modify it @@ -16,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -308,7 +312,3 @@ static int __init altera_msi_init(void) return platform_driver_register(_msi_driver); } subsys_initcall(altera_msi_init); - -MODULE_AUTHOR("Ley Foon Tan "); -MODULE_DESCRIPTION("Altera PCIe MSI support"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 0/8] PCI: more trivial demodularization of builtin code
This is another group of commits that was chosen since they really don't change anything even at a binary object file level ; they just replace module_init with device_initcall (which are identical), and remove some MODULE_ tags that are no-ops in code. So the run time regression risk is zero here. More specifically, we are doing the following to these PCI files that currently can only be built-in: -- remove the include of module.h ; replace it with init.h as req'd -- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in. -- replace module_init (if present) with device_initcall, which is functionally identical once CPP has processed the source. -- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION while ensuring the contained info is present in the file comments. Build tested for allmodconfig on several arch, including ARM and ARM-64 on a recent linux-next baseline. Some non-modular PCI files still remain with unused __exit and/or .remove functions. Those will be dealt with in a separate series after this. Also note that we looked into modularizing some of the PCI_DW stuff at an earlier time[1] but that ran into problems such as trying to create unwind for hook_fault_code etc. that wasn't easily solved. So we just go with keeping the code runtime functionally equivalent to what it was. Paul. [1] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortma...@windriver.com --- Cc: Bjorn Helgaas Cc: Jingoo Han Cc: Krzysztof Kozlowski Cc: Kukjin Kim Cc: Ley Foon Tan Cc: Lucas Stach Cc: Pratyush Anand Cc: Richard Zhu Cc: Tom Long Nguyen Cc: Will Deacon Cc: r...@lists.rocketboards.org Cc: linux-...@vger.kernel.org Cc: linux-samsung-...@vger.kernel.org Paul Gortmaker (8): PCI: altera: make msi explicitly non-modular PCI: altera: make it explicitly non-modular PCI: imx6: make it explicitly non-modular PCI: portdrv: make it explicitly non-modular PCI: spear13xx: make it explicitly non-modular PCI: designware: make host support explicitly non-modular PCI: exynos: make host support explicitly non-modular PCI: generic: make host-common explicitly non-modular drivers/pci/host/pci-exynos.c | 7 +-- drivers/pci/host/pci-host-common.c | 7 ++- drivers/pci/host/pci-imx6.c| 9 + drivers/pci/host/pcie-altera-msi.c | 10 +- drivers/pci/host/pcie-altera.c | 12 +--- drivers/pci/host/pcie-designware.c | 5 - drivers/pci/host/pcie-spear13xx.c | 11 ++- drivers/pci/pcie/portdrv_pci.c | 8 +--- 8 files changed, 17 insertions(+), 52 deletions(-) -- 2.8.4
[PATCH 4/4] gpio: vf610: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is: drivers/gpio/Kconfig:config GPIO_VF610 drivers/gpio/Kconfig: def_bool y ...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 now contained at the top of the file in the comments. We don't replace module.h with init.h since the file already has that. Cc: Linus Walleij <linus.wall...@linaro.org> Cc: Alexandre Courbot <gnu...@gmail.com> Cc: Stefan Agner <ste...@agner.ch> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/gpio/gpio-vf610.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index 6284bdbe1e0c..3edb09cb9ee0 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -1,5 +1,5 @@ /* - * vf610 GPIO support through PORT and GPIO module + * Freescale vf610 GPIO support through PORT and GPIO * * Copyright (c) 2014 Toradex AG. * @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -289,7 +288,3 @@ static int __init gpio_vf610_init(void) return platform_driver_register(_gpio_driver); } device_initcall(gpio_vf610_init); - -MODULE_AUTHOR("Stefan Agner <ste...@agner.ch>"); -MODULE_DESCRIPTION("Freescale VF610 GPIO"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 2/4] gpio: mxc: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is: drivers/gpio/Kconfig:config GPIO_MXC drivers/gpio/Kconfig: def_bool y ...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 was (or is now) contained at the top of the file in the comments. Note the original e-mail had a missing/typo'd @ symbol anyway. We don't replace module.h with init.h since the file already has that. Cc: Linus Walleij <linus.wall...@linaro.org> Cc: Alexandre Courbot <gnu...@gmail.com> Cc: Daniel Mack <dan...@caiaq.de> Cc: Juergen Beisert <ker...@pengutronix.de> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/gpio/gpio-mxc.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 1b342a3842c8..e35af5249478 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -2,7 +2,8 @@ * MXC GPIO support. (c) 2008 Daniel Mack <dan...@caiaq.de> * Copyright 2008 Juergen Beisert, ker...@pengutronix.de * - * Based on code from Freescale, + * Based on code from Freescale Semiconductor, + * Authors: Daniel Mack, Juergen Beisert. * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or @@ -33,7 +34,6 @@ #include #include #include -#include #include enum mxc_gpio_hwtype { @@ -511,9 +511,3 @@ static int __init gpio_mxc_init(void) return platform_driver_register(_gpio_driver); } postcore_initcall(gpio_mxc_init); - -MODULE_AUTHOR("Freescale Semiconductor, " - "Daniel Mack , " - "Juergen Beisert <ker...@pengutronix.de>"); -MODULE_DESCRIPTION("Freescale MXC GPIO"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 4/4] gpio: vf610: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is: drivers/gpio/Kconfig:config GPIO_VF610 drivers/gpio/Kconfig: def_bool y ...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 now contained at the top of the file in the comments. We don't replace module.h with init.h since the file already has that. Cc: Linus Walleij Cc: Alexandre Courbot Cc: Stefan Agner Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/gpio/gpio-vf610.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index 6284bdbe1e0c..3edb09cb9ee0 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -1,5 +1,5 @@ /* - * vf610 GPIO support through PORT and GPIO module + * Freescale vf610 GPIO support through PORT and GPIO * * Copyright (c) 2014 Toradex AG. * @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -289,7 +288,3 @@ static int __init gpio_vf610_init(void) return platform_driver_register(_gpio_driver); } device_initcall(gpio_vf610_init); - -MODULE_AUTHOR("Stefan Agner "); -MODULE_DESCRIPTION("Freescale VF610 GPIO"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 2/4] gpio: mxc: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is: drivers/gpio/Kconfig:config GPIO_MXC drivers/gpio/Kconfig: def_bool y ...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 was (or is now) contained at the top of the file in the comments. Note the original e-mail had a missing/typo'd @ symbol anyway. We don't replace module.h with init.h since the file already has that. Cc: Linus Walleij Cc: Alexandre Courbot Cc: Daniel Mack Cc: Juergen Beisert Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/gpio/gpio-mxc.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 1b342a3842c8..e35af5249478 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -2,7 +2,8 @@ * MXC GPIO support. (c) 2008 Daniel Mack * Copyright 2008 Juergen Beisert, ker...@pengutronix.de * - * Based on code from Freescale, + * Based on code from Freescale Semiconductor, + * Authors: Daniel Mack, Juergen Beisert. * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or @@ -33,7 +34,6 @@ #include #include #include -#include #include enum mxc_gpio_hwtype { @@ -511,9 +511,3 @@ static int __init gpio_mxc_init(void) return platform_driver_register(_gpio_driver); } postcore_initcall(gpio_mxc_init); - -MODULE_AUTHOR("Freescale Semiconductor, " - "Daniel Mack , " - "Juergen Beisert "); -MODULE_DESCRIPTION("Freescale MXC GPIO"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 3/4] gpio: spear-spics: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is: drivers/gpio/Kconfig:config GPIO_SPEAR_SPICS drivers/gpio/Kconfig: bool "ST SPEAr13xx SPI Chip Select as GPIO 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 now contained at the top of the file in the comments. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. Cc: Linus Walleij <linus.wall...@linaro.org> Cc: Alexandre Courbot <gnu...@gmail.com> Cc: Shiraz Hashim <shiraz.linux.ker...@gmail.com> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/gpio/gpio-spear-spics.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c index 7ffd16495286..22267479ba68 100644 --- a/drivers/gpio/gpio-spear-spics.c +++ b/drivers/gpio/gpio-spear-spics.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -183,7 +183,6 @@ static const struct of_device_id spics_gpio_of_match[] = { { .compatible = "st,spear-spics-gpio" }, {} }; -MODULE_DEVICE_TABLE(of, spics_gpio_of_match); static struct platform_driver spics_gpio_driver = { .probe = spics_gpio_probe, @@ -198,7 +197,3 @@ static int __init spics_gpio_init(void) return platform_driver_register(_gpio_driver); } subsys_initcall(spics_gpio_init); - -MODULE_AUTHOR("Shiraz Hashim <shiraz.linux.ker...@gmail.com>"); -MODULE_DESCRIPTION("STMicroelectronics SPEAr SPI Chip Select Abstraction"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 0/4] gpio: delete MODULE_ tags in non-modular drivers
A nice simple series, with zero runtime changes. We delete tags like MODULE_LICENSE, MODULE_AUTHOR (while ensuring the documentation at the top of file reflects author and license) etc from bool drivers where the tags are no-ops. Then we are free to delete the module.h include, which we now know adds about 750kB of output to an otherwise headerless empty file processed by cpp. In addition, it will be clear that the driver is non-modular now, when inspecting the source code. --- Cc: Alexandre Courbot <gnu...@gmail.com> Cc: Daniel Mack <dan...@caiaq.de> Cc: Juergen Beisert <ker...@pengutronix.de> Cc: Linus Walleij <linus.wall...@linaro.org> Cc: Mathias Nyman <mathias.ny...@linux.intel.com> Cc: Shiraz Hashim <shiraz.linux.ker...@gmail.com> Cc: Stefan Agner <ste...@agner.ch> Cc: linux-g...@vger.kernel.org Paul Gortmaker (4): gpio: msic: drop unused MODULE_ tags from non-modular code gpio: mxc: drop unused MODULE_ tags from non-modular code gpio: spear-spics: drop unused MODULE_ tags from non-modular code gpio: vf610: drop unused MODULE_ tags from non-modular code drivers/gpio/gpio-msic.c| 6 -- drivers/gpio/gpio-mxc.c | 10 ++ drivers/gpio/gpio-spear-spics.c | 7 +-- drivers/gpio/gpio-vf610.c | 7 +-- 4 files changed, 4 insertions(+), 26 deletions(-) -- 2.8.4
[PATCH 3/4] gpio: spear-spics: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is: drivers/gpio/Kconfig:config GPIO_SPEAR_SPICS drivers/gpio/Kconfig: bool "ST SPEAr13xx SPI Chip Select as GPIO 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 now contained at the top of the file in the comments. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. Cc: Linus Walleij Cc: Alexandre Courbot Cc: Shiraz Hashim Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/gpio/gpio-spear-spics.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c index 7ffd16495286..22267479ba68 100644 --- a/drivers/gpio/gpio-spear-spics.c +++ b/drivers/gpio/gpio-spear-spics.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -183,7 +183,6 @@ static const struct of_device_id spics_gpio_of_match[] = { { .compatible = "st,spear-spics-gpio" }, {} }; -MODULE_DEVICE_TABLE(of, spics_gpio_of_match); static struct platform_driver spics_gpio_driver = { .probe = spics_gpio_probe, @@ -198,7 +197,3 @@ static int __init spics_gpio_init(void) return platform_driver_register(_gpio_driver); } subsys_initcall(spics_gpio_init); - -MODULE_AUTHOR("Shiraz Hashim "); -MODULE_DESCRIPTION("STMicroelectronics SPEAr SPI Chip Select Abstraction"); -MODULE_LICENSE("GPL"); -- 2.8.4
[PATCH 0/4] gpio: delete MODULE_ tags in non-modular drivers
A nice simple series, with zero runtime changes. We delete tags like MODULE_LICENSE, MODULE_AUTHOR (while ensuring the documentation at the top of file reflects author and license) etc from bool drivers where the tags are no-ops. Then we are free to delete the module.h include, which we now know adds about 750kB of output to an otherwise headerless empty file processed by cpp. In addition, it will be clear that the driver is non-modular now, when inspecting the source code. --- Cc: Alexandre Courbot Cc: Daniel Mack Cc: Juergen Beisert Cc: Linus Walleij Cc: Mathias Nyman Cc: Shiraz Hashim Cc: Stefan Agner Cc: linux-g...@vger.kernel.org Paul Gortmaker (4): gpio: msic: drop unused MODULE_ tags from non-modular code gpio: mxc: drop unused MODULE_ tags from non-modular code gpio: spear-spics: drop unused MODULE_ tags from non-modular code gpio: vf610: drop unused MODULE_ tags from non-modular code drivers/gpio/gpio-msic.c| 6 -- drivers/gpio/gpio-mxc.c | 10 ++ drivers/gpio/gpio-spear-spics.c | 7 +-- drivers/gpio/gpio-vf610.c | 7 +-- 4 files changed, 4 insertions(+), 26 deletions(-) -- 2.8.4
[PATCH 1/4] gpio: msic: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is: drivers/gpio/Kconfig:config GPIO_MSIC drivers/gpio/Kconfig: bool "Intel MSIC mixed signal gpio 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. We don't replace module.h with init.h since the file already has that. Cc: Linus Walleij <linus.wall...@linaro.org> Cc: Alexandre Courbot <gnu...@gmail.com> Cc: Mathias Nyman <mathias.ny...@linux.intel.com> Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- drivers/gpio/gpio-msic.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c index d75649787e6c..1b7ce7f85886 100644 --- a/drivers/gpio/gpio-msic.c +++ b/drivers/gpio/gpio-msic.c @@ -20,7 +20,6 @@ * */ -#include #include #include #include @@ -328,9 +327,4 @@ static int __init platform_msic_gpio_init(void) { return platform_driver_register(_msic_gpio_driver); } - subsys_initcall(platform_msic_gpio_init); - -MODULE_AUTHOR("Mathias Nyman <mathias.ny...@linux.intel.com>"); -MODULE_DESCRIPTION("Intel Medfield MSIC GPIO driver"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
[PATCH 1/4] gpio: msic: drop unused MODULE_ tags from non-modular code
The Kconfig currently controlling compilation of this code is: drivers/gpio/Kconfig:config GPIO_MSIC drivers/gpio/Kconfig: bool "Intel MSIC mixed signal gpio 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. We don't replace module.h with init.h since the file already has that. Cc: Linus Walleij Cc: Alexandre Courbot Cc: Mathias Nyman Cc: linux-g...@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/gpio/gpio-msic.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c index d75649787e6c..1b7ce7f85886 100644 --- a/drivers/gpio/gpio-msic.c +++ b/drivers/gpio/gpio-msic.c @@ -20,7 +20,6 @@ * */ -#include #include #include #include @@ -328,9 +327,4 @@ static int __init platform_msic_gpio_init(void) { return platform_driver_register(_msic_gpio_driver); } - subsys_initcall(platform_msic_gpio_init); - -MODULE_AUTHOR("Mathias Nyman "); -MODULE_DESCRIPTION("Intel Medfield MSIC GPIO driver"); -MODULE_LICENSE("GPL v2"); -- 2.8.4
Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h
[Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h] On 17/08/2016 (Wed 18:15) Al Viro wrote: > On Tue, Aug 16, 2016 at 11:14:42AM -0400, Paul Gortmaker wrote: > > Most of the other C content in this file is already implemented > > in macro form. Doing the same for this function will allow us > > to get rid of the duplicated search_exception_tables prototype. > > We will bring it in as required via inclusion. > > What is it doing in uaccess.h in the first place? ia64_done_with_exception() > is used only in the guts of arch/ia64 (2 in kernel, 1 in mm), so why dump it > into a widely-used header? Looking at arm and alpha, it seems there are other arch that have exception stuff in their own arch specific uaccess.h file, so I'm guessing it got there in ia64 just by happenstance of copying existing implementations. THere is a precedent for arch specific asm/exception.h -- we could create one for ia64 and move the chunks over there if folks thought that was worthwhile I suppose. Paul. --
Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h
[Re: [PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h] On 17/08/2016 (Wed 18:15) Al Viro wrote: > On Tue, Aug 16, 2016 at 11:14:42AM -0400, Paul Gortmaker wrote: > > Most of the other C content in this file is already implemented > > in macro form. Doing the same for this function will allow us > > to get rid of the duplicated search_exception_tables prototype. > > We will bring it in as required via inclusion. > > What is it doing in uaccess.h in the first place? ia64_done_with_exception() > is used only in the guts of arch/ia64 (2 in kernel, 1 in mm), so why dump it > into a widely-used header? Looking at arm and alpha, it seems there are other arch that have exception stuff in their own arch specific uaccess.h file, so I'm guessing it got there in ia64 just by happenstance of copying existing implementations. THere is a precedent for arch specific asm/exception.h -- we could create one for ia64 and move the chunks over there if folks thought that was worthwhile I suppose. Paul. --
[tip:timers/urgent] clocksource/drivers/mips-gic-timer: Make gic_clocksource_of_init() return int
Commit-ID: be5769e2061ac40b32daa83e28e1c4aac7133511 Gitweb: http://git.kernel.org/tip/be5769e2061ac40b32daa83e28e1c4aac7133511 Author: Paul Gortmaker <paul.gortma...@windriver.com> AuthorDate: Wed, 17 Aug 2016 12:21:35 +0200 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Wed, 17 Aug 2016 13:08:32 +0200 clocksource/drivers/mips-gic-timer: Make gic_clocksource_of_init() return int In commit: d8152bf85d2c0 ("clocksource/drivers/mips-gic-timer: Convert init function to return error") several return values were added to a void function resulting in the following warnings: clocksource/mips-gic-timer.c: In function 'gic_clocksource_of_init': clocksource/mips-gic-timer.c:175:3: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:183:4: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:190:3: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:195:3: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:200:3: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:211:2: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c: At top level: clocksource/mips-gic-timer.c:213:1: warning: comparison of distinct pointer types lacks a cast [enabled by default] clocksource/mips-gic-timer.c: In function 'gic_clocksource_of_init': clocksource/mips-gic-timer.c:183:18: warning: ignoring return value of 'PTR_ERR', declared with attribute warn_unused_result [-Wunused-result] Given that the addition of the return values was intentional, it seems that the conversion of the containing function from void to int was simply overlooked. Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> Signed-off-by: Daniel Lezcano <daniel.lezc...@linaro.org> Cc: Linus Torvalds <torva...@linux-foundation.org> Cc: Peter Zijlstra <pet...@infradead.org> Cc: Thomas Gleixner <t...@linutronix.de> Cc: linux-m...@linux-mips.org Fixes: d8152bf85d2c ("clocksource/drivers/mips-gic-timer: Convert init function to return error") Link: http://lkml.kernel.org/r/1471429296-9053-3-git-send-email-daniel.lezc...@linaro.org Signed-off-by: Ingo Molnar <mi...@kernel.org> --- drivers/clocksource/mips-gic-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c index d91e872..b4b3ab5 100644 --- a/drivers/clocksource/mips-gic-timer.c +++ b/drivers/clocksource/mips-gic-timer.c @@ -164,7 +164,7 @@ void __init gic_clocksource_init(unsigned int frequency) gic_start_count(); } -static void __init gic_clocksource_of_init(struct device_node *node) +static int __init gic_clocksource_of_init(struct device_node *node) { struct clk *clk; int ret;
[tip:timers/urgent] clocksource/drivers/mips-gic-timer: Make gic_clocksource_of_init() return int
Commit-ID: be5769e2061ac40b32daa83e28e1c4aac7133511 Gitweb: http://git.kernel.org/tip/be5769e2061ac40b32daa83e28e1c4aac7133511 Author: Paul Gortmaker AuthorDate: Wed, 17 Aug 2016 12:21:35 +0200 Committer: Ingo Molnar CommitDate: Wed, 17 Aug 2016 13:08:32 +0200 clocksource/drivers/mips-gic-timer: Make gic_clocksource_of_init() return int In commit: d8152bf85d2c0 ("clocksource/drivers/mips-gic-timer: Convert init function to return error") several return values were added to a void function resulting in the following warnings: clocksource/mips-gic-timer.c: In function 'gic_clocksource_of_init': clocksource/mips-gic-timer.c:175:3: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:183:4: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:190:3: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:195:3: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:200:3: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c:211:2: warning: 'return' with a value, in function returning void [enabled by default] clocksource/mips-gic-timer.c: At top level: clocksource/mips-gic-timer.c:213:1: warning: comparison of distinct pointer types lacks a cast [enabled by default] clocksource/mips-gic-timer.c: In function 'gic_clocksource_of_init': clocksource/mips-gic-timer.c:183:18: warning: ignoring return value of 'PTR_ERR', declared with attribute warn_unused_result [-Wunused-result] Given that the addition of the return values was intentional, it seems that the conversion of the containing function from void to int was simply overlooked. Signed-off-by: Paul Gortmaker Signed-off-by: Daniel Lezcano Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-m...@linux-mips.org Fixes: d8152bf85d2c ("clocksource/drivers/mips-gic-timer: Convert init function to return error") Link: http://lkml.kernel.org/r/1471429296-9053-3-git-send-email-daniel.lezc...@linaro.org Signed-off-by: Ingo Molnar --- drivers/clocksource/mips-gic-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c index d91e872..b4b3ab5 100644 --- a/drivers/clocksource/mips-gic-timer.c +++ b/drivers/clocksource/mips-gic-timer.c @@ -164,7 +164,7 @@ void __init gic_clocksource_init(unsigned int frequency) gic_start_count(); } -static void __init gic_clocksource_of_init(struct device_node *node) +static int __init gic_clocksource_of_init(struct device_node *node) { struct clk *clk; int ret;
[PATCH 0/2] ia64: make use of new extable.h header
We forked the exception table content out of module.h into a new extable.h file[1]. We temporarily include extable.h into the module.h itself. Now we work our way across the arch independent and arch specific files needing just exception table content, and move them off module.h and onto extable.h Once that is done, we can remove the extable.h from module.h and in doing it like this, we avoid introducing build failures into the git history. Here we move ia64 onto using the new header, and in doing so also macro-ize something in uaccess.h to make it more consistent with the rest of that file. Paul. [1] https://lkml.org/lkml/2016/7/24/224 -- Paul Gortmaker (2): ia64: macro-ize ia64_done_with_exception in asm/uaccess.h ia64: ensure exception table search users include extable.h arch/ia64/include/asm/uaccess.h | 28 ++-- arch/ia64/kernel/kprobes.c | 2 +- arch/ia64/kernel/traps.c| 3 ++- arch/ia64/kernel/unaligned.c| 1 + arch/ia64/mm/fault.c| 1 + 5 files changed, 19 insertions(+), 16 deletions(-) -- 2.8.4
[PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h
Most of the other C content in this file is already implemented in macro form. Doing the same for this function will allow us to get rid of the duplicated search_exception_tables prototype. We will bring it in as required via inclusion. Cc: Tony Luck <tony.l...@intel.com> Cc: Fenghua Yu <fenghua...@intel.com> Cc: linux-i...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- arch/ia64/include/asm/uaccess.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h index 465c70982f40..4b52b79213a3 100644 --- a/arch/ia64/include/asm/uaccess.h +++ b/arch/ia64/include/asm/uaccess.h @@ -363,17 +363,17 @@ struct exception_table_entry { extern void ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e); extern const struct exception_table_entry *search_exception_tables (unsigned long addr); -static inline int -ia64_done_with_exception (struct pt_regs *regs) -{ - const struct exception_table_entry *e; - e = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri); - if (e) { - ia64_handle_exception(regs, e); - return 1; - } - return 0; -} +#define ia64_done_with_exception(regs) \ +({ \ + int __ex_ret = 0; \ + const struct exception_table_entry *e;\ + e = search_exception_tables((regs)->cr_iip + ia64_psr(regs)->ri); \ + if (e) { \ + ia64_handle_exception(regs, e); \ + __ex_ret = 1; \ + } \ + __ex_ret; \ +}) #define ARCH_HAS_TRANSLATE_MEM_PTR 1 static __inline__ void * -- 2.8.4
[PATCH 2/2] ia64: ensure exception table search users include extable.h
We start with a delete of a duplicate prototype in asm/uaccess.h that doesn't need to exist, as it duplicates content in extable.h and since that header is so small, there is no point trying to avoid using it. Then we make sure anyone using search_exception_tables directly or via the ia64_done_with_exception macro has included extable.h In the process, we remove an include of moduleloader.h that was apparently not really required; it would have been fetching in module.h and hence the previous location of the exception search function prototypes, but we need not rely on that anymore. Cc: Tony Luck <tony.l...@intel.com> Cc: Fenghua Yu <fenghua...@intel.com> Cc: linux-i...@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortma...@windriver.com> --- arch/ia64/include/asm/uaccess.h | 4 ++-- arch/ia64/kernel/kprobes.c | 2 +- arch/ia64/kernel/traps.c| 3 ++- arch/ia64/kernel/unaligned.c| 1 + arch/ia64/mm/fault.c| 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h index 4b52b79213a3..647e43d0a157 100644 --- a/arch/ia64/include/asm/uaccess.h +++ b/arch/ia64/include/asm/uaccess.h @@ -360,8 +360,8 @@ struct exception_table_entry { int fixup; /* location-relative continuation addr.; if bit 2 is set, r9 is set to 0 */ }; -extern void ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e); -extern const struct exception_table_entry *search_exception_tables (unsigned long addr); +extern void ia64_handle_exception(struct pt_regs *regs, + const struct exception_table_entry *e); #define ia64_done_with_exception(regs) \ ({ \ diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index c7c51445c3be..671389430e90 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c index 77edd68c5161..f36d3c9e1961 100644 --- a/arch/ia64/kernel/traps.c +++ b/arch/ia64/kernel/traps.c @@ -12,7 +12,8 @@ #include #include #include /* For unblank_screen() */ -#include/* for EXPORT_SYMBOL */ +#include +#include #include #include #include/* for ssleep() */ diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c index 7f0d31656b4d..7224890ea311 100644 --- a/arch/ia64/kernel/unaligned.c +++ b/arch/ia64/kernel/unaligned.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index fa6ad95e992e..702f4b0845ab 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include -- 2.8.4
[PATCH 0/2] ia64: make use of new extable.h header
We forked the exception table content out of module.h into a new extable.h file[1]. We temporarily include extable.h into the module.h itself. Now we work our way across the arch independent and arch specific files needing just exception table content, and move them off module.h and onto extable.h Once that is done, we can remove the extable.h from module.h and in doing it like this, we avoid introducing build failures into the git history. Here we move ia64 onto using the new header, and in doing so also macro-ize something in uaccess.h to make it more consistent with the rest of that file. Paul. [1] https://lkml.org/lkml/2016/7/24/224 -- Paul Gortmaker (2): ia64: macro-ize ia64_done_with_exception in asm/uaccess.h ia64: ensure exception table search users include extable.h arch/ia64/include/asm/uaccess.h | 28 ++-- arch/ia64/kernel/kprobes.c | 2 +- arch/ia64/kernel/traps.c| 3 ++- arch/ia64/kernel/unaligned.c| 1 + arch/ia64/mm/fault.c| 1 + 5 files changed, 19 insertions(+), 16 deletions(-) -- 2.8.4
[PATCH 1/2] ia64: macro-ize ia64_done_with_exception in asm/uaccess.h
Most of the other C content in this file is already implemented in macro form. Doing the same for this function will allow us to get rid of the duplicated search_exception_tables prototype. We will bring it in as required via inclusion. Cc: Tony Luck Cc: Fenghua Yu Cc: linux-i...@vger.kernel.org Signed-off-by: Paul Gortmaker --- arch/ia64/include/asm/uaccess.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h index 465c70982f40..4b52b79213a3 100644 --- a/arch/ia64/include/asm/uaccess.h +++ b/arch/ia64/include/asm/uaccess.h @@ -363,17 +363,17 @@ struct exception_table_entry { extern void ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e); extern const struct exception_table_entry *search_exception_tables (unsigned long addr); -static inline int -ia64_done_with_exception (struct pt_regs *regs) -{ - const struct exception_table_entry *e; - e = search_exception_tables(regs->cr_iip + ia64_psr(regs)->ri); - if (e) { - ia64_handle_exception(regs, e); - return 1; - } - return 0; -} +#define ia64_done_with_exception(regs) \ +({ \ + int __ex_ret = 0; \ + const struct exception_table_entry *e;\ + e = search_exception_tables((regs)->cr_iip + ia64_psr(regs)->ri); \ + if (e) { \ + ia64_handle_exception(regs, e); \ + __ex_ret = 1; \ + } \ + __ex_ret; \ +}) #define ARCH_HAS_TRANSLATE_MEM_PTR 1 static __inline__ void * -- 2.8.4