drivers/pinctrl: remove truly orphaned module code
Subsystems (10)
cover drivers/pinctrl: remove truly orphaned module code
This series of commits is a part of a larger project to ensure people don't reference modular support functions in non-modular code. Overall there was roughly 5k lines of dead code in the kernel due to this. So far we've fixed several areas, like tty, x86, net, ... and we continue to work on other areas.
There are several reasons to not use module support for code that can never be built as a module, but the big ones 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 code and spreads like weeds.
This group represents roughly 1/2 of the pinctrl commits I've got under testing locally. The commonality within this group is that there should be zero runtime changes with this series, because none of the drivers here deployed a ".remove" field which in turn would cause me to add the ".suppress_bind_attrs = true," to the driver struct. Similarly there is no change in the initcall ordering either.
So hopefully with that in mind it eases review.
I'm happy to have this go in via the maintainer's tree and reduce the (large) number of patches I'm carrying locally.
---
Paul Gortmaker (8):
drivers/pinctrl: sunxi/pinctrl-sunxi.c does not need module.h drivers/pinctrl: make mediatek/pinctrl-mt6397 driver explicitly non-modular drivers/pinctrl: make meson/pinctrl-meson.c explicitly non-modular drivers/pinctrl: make sh-pfc/core.c explicitly non-modular drivers/pinctrl: make stm32/pinctrl-stm32f429.c explicitly non-modular drivers/pinctrl: make sunxi/pinctrl-sun[4-9]* explicitly non-modular drivers/pinctrl: make sunxi/pinctrl-sun9i-a80-r.c explicitly non-modular drivers/pinctrl: clean up samsung modular vs. non-modular distinctions
drivers/pinctrl/mediatek/pinctrl-mt6397.c | 10 ++-------- drivers/pinctrl/meson/pinctrl-meson.c | 8 +------- drivers/pinctrl/samsung/pinctrl-exynos.c | 1 - drivers/pinctrl/samsung/pinctrl-exynos5440.c | 15 +++------------ drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-samsung.c | 12 +----------- drivers/pinctrl/sh-pfc/core.c | 18 ++++-------------- drivers/pinctrl/stm32/pinctrl-stm32f429.c | 9 +-------- drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun5i-a13.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c | 10 ++-------- drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun6i-a31s.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c | 11 ++--------- drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c | 10 ++-------- drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +- 22 files changed, 39 insertions(+), 152 deletions(-)
Signature · 1 line
2.6.1
PATCH 1/8 drivers/pinctrl: sunxi/pinctrl-sunxi.c does not need module.h
This file is not modular, nor is it using modular functions. The only thing close is the global THIS_MODULE which comes from export.h so lets replace it appropriately and cut back on the amount of header stuff we draw in by several thousand lines.
--- drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sunxi/pinctrl-sunxi.c +1 -1
@@ -15,7 +15,7 @@#include <linux/gpio/driver.h> #include <linux/irqdomain.h> #include <linux/irqchip/chained_irq.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_device.h>
Signature · 1 line
2.6.1
Re: [PATCH 1/8] drivers/pinctrl: sunxi/pinctrl-sunxi.c does not need module.h
Quoted 10 lines · Paul Gortmaker
This file is not modular, nor is it using modular functions. The only thing close is the global
THIS_MODULEwhich comes fromexport.hso lets replace it appropriately and cut back on the amount of header stuff we draw in by several thousand lines.Cc Linus Walleij <[email protected]>Cc Maxime Ripard <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Paul Gortmaker <[email protected]>
Thanks,
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160229/5a0cd778/attachment.sig>
Re: [PATCH 1/8] drivers/pinctrl: sunxi/pinctrl-sunxi.c does not need module.h
In reply to Paul GortmakerQuoted 10 lines · Paul Gortmaker
This file is not modular, nor is it using modular functions. The only thing close is the global
THIS_MODULEwhich comes fromexport.hso lets replace it appropriately and cut back on the amount of header stuff we draw in by several thousand lines.Cc Linus Walleij <[email protected]>Cc Maxime Ripard <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Paul Gortmaker <[email protected]>
Patch applied with Maxime's ACK.
Yours,
Linus Walleij
PATCH 2/8 drivers/pinctrl: make mediatek/pinctrl-mt6397 driver explicitly non-modular
In reply to Paul GortmakerThe Kconfig for this driver is currently:
config PINCTRL_MT6397
bool "Mediatek MT6397 pin control" if COMPILE_TEST && !MFD_MT6397
...meaning that it is currently not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.
We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.
Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
--- drivers/pinctrl/mediatek/pinctrl-mt6397.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/pinctrl/mediatek/pinctrl-mt6397.c +2 -8
@@ -12,7 +12,7 @@* GNU General Public License for more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -55,7 +55,6 @@ static const struct of_device_id mt6397_pctrl_match[] = { { .compatible = "mediatek,mt6397-pinctrl", }, { } }; -MODULE_DEVICE_TABLE (of, mt6397_pctrl_match);static struct platform_driver mtk_pinctrl_driver = { .probe = mt6397_pinctrl_probe,
@@ -69,9 +68,4 @@ static int __init mtk_pinctrl_init(void) {return platform_driver_register (&mtk_pinctrl_driver); } - -module_init (mtk_pinctrl_init); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("MediaTek MT6397 Pinctrl Driver" ); -MODULE_AUTHOR ("Hongzhou Yang <hongzhou.yang-NuS5LvNUpcJWk0Htik3J/[email protected]>" ); +device_initcall (mtk_pinctrl_init);
Signature · 1 line
2.6.1
Re: [PATCH 2/8] drivers/pinctrl: make mediatek/pinctrl-mt6397 driver explicitly non-modular
Quoted 49 lines · Paul Gortmaker
The
Kconfigfor this driver is currently:config
PINCTRL_MT6397bool "Mediatek MT6397 pin control" if COMPILE_TEST && !MFD_MT6397...meaning that it is currently 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_inittranslates todevice_initcallin the non-modular case, the init ordering remains unchanged with this commit.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.Cc Linus Walleij <[email protected]>Cc Matthias Brugger <[email protected]>Cc Hongzhou Yang <hongzhou.yang-NuS5LvNUpcJWk0Htik3J/[email protected]>Signed-off-by Paul Gortmaker <[email protected]>--- drivers/pinctrl/mediatek/pinctrl-mt6397.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)drivers/pinctrl/mediatek/pinctrl-mt6397.c +1
-2@@ -12,7 +12,7 @@* GNU General Public License for more details. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h> @@ -55,7 +55,6 @@ static const struct of_device_id mt6397_pctrl_match[] = { { .compatible = "mediatek,mt6397-pinctrl", }, { } }; -MODULE_DEVICE_TABLE (of, mt6397_pctrl_match);static struct platform_driver mtk_pinctrl_driver = { .probe = mt6397_pinctrl_probe,
drivers/pinctrl/mediatek/pinctrl-mt6397.c static int __init mtk_pinctrl_init(void) · line 71
Quoted 10 lines
drivers/pinctrl/mediatek/pinctrl-mt6397.c +1
-6@@ -69,9 +68,4 @@ static int __init mtk_pinctrl_init(void) {return platform_driver_register (&mtk_pinctrl_driver); } - -module_init (mtk_pinctrl_init); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("MediaTek MT6397 Pinctrl Driver" ); -MODULE_AUTHOR ("Hongzhou Yang <hongzhou.yang-NuS5LvNUpcJWk0Htik3J/[email protected]>" ); +device_initcall (mtk_pinctrl_init);
Thanks,
Hongzhou
Re: [PATCH 2/8] drivers/pinctrl: make mediatek/pinctrl-mt6397 driver explicitly non-modular
In reply to Paul GortmakerQuoted 15 lines · Paul Gortmaker
The
Kconfigfor this driver is currently:config
PINCTRL_MT6397bool "Mediatek MT6397 pin control" if COMPILE_TEST && !MFD_MT6397...meaning that it is currently 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_inittranslates todevice_initcallin the non-modular case, the init ordering remains unchanged with this commit.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 8 lines
Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.Cc Linus Walleij <[email protected]>Cc Matthias Brugger <[email protected]>Cc Hongzhou Yang <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Patch applied with Honzhou's ACK.
Yours,
Linus Walleij
PATCH 3/8 drivers/pinctrl: make meson/pinctrl-meson.c explicitly non-modular
In reply to Paul GortmakerThe Kconfig currently controlling compilation of this code is:
drivers/pinctrl/Kconfig:config PINCTRL_MESONdrivers/pinctrl/Kconfig: bool
...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 don't replace module.h with init.h since the file already has that.
Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments.
--- drivers/pinctrl/meson/pinctrl-meson.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/pinctrl/meson/pinctrl-meson.c +1 -7
@@ -49,7 +49,6 @@#include <linux/gpio.h> #include <linux/init.h> #include <linux/io.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/pinctrl/pinconf-generic.h>
@@ -546,7 +545,6 @@ static const struct of_device_id meson_pinctrl_dt_match[] = { }, { }, }; -MODULE_DEVICE_TABLE (of, meson_pinctrl_dt_match);static int meson_gpiolib_register (struct meson_pinctrl *pc) {
@@ -754,8 +752,4 @@ static struct platform_driver meson_pinctrl_driver = { .of_match_table = meson_pinctrl_dt_match, }, }; -module_platform_driver (meson_pinctrl_driver); - -MODULE_AUTHOR ("Beniamino Galvani <[email protected]>" ); -MODULE_DESCRIPTION ("Amlogic Meson pinctrl driver" ); -MODULE_LICENSE ("GPL v2" ); +builtin_platform_driver (meson_pinctrl_driver);
Signature · 1 line
2.6.1
Re: [PATCH 3/8] drivers/pinctrl: make meson/pinctrl-meson.c explicitly non-modular
Quoted 21 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/pinctrl/Kconfig:config
PINCTRL_MESONdrivers/pinctrl/Kconfig: bool...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the driver there is no doubt it is builtin-only.
Since
module_platform_driver()uses the same init level priority asbuiltin_platform_driver()the init ordering remains unchanged with this commit.We don't replace
module.hwithinit.hsince the file already has that.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 7 lines
Cc Linus Walleij <[email protected]>Cc Beniamino Galvani <[email protected]>Cc Carlo Caione <[email protected]>Cc Masahiro Yamada <[email protected]>Cc Antoine Tenart <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 4/8 drivers/pinctrl: make sh-pfc/core.c explicitly non-modular
In reply to Paul GortmakerThe Kconfig / Makefile currently controlling compilation of this code is:
drivers/pinctrl/sh-pfc/Makefile:obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc.o
drivers/pinctrl/sh-pfc/Makefile:sh-pfc-objs = core.o pinctrl.o
drivers/pinctrl/sh-pfc/Kconfig:config PINCTRL_SH_PFC drivers/pinctrl/sh-pfc/Kconfig: def_bool y
...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 already wasn't being used in this code, the init ordering remains unchanged with this commit.
Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.
--- drivers/pinctrl/sh-pfc/core.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)
drivers/pinctrl/sh-pfc/core.c +4 -14
@@ -1,5 +1,7 @@/* -* SuperH Pin Function Controller support. +* Pin Control and GPIO driver for SuperH Pin Function Controller. +* +* Authors: Magnus Damm, Paul Mundt, Laurent Pinchart * * Copyright (C) 2008 Magnus Damm * Copyright (C) 2009 - 2012 Paul Mundt
@@ -17,7 +19,7 @@#include <linux/io.h> #include <linux/ioport.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/pinctrl/machine.h>
@@ -503,7 +505,6 @@ static const struct of_device_id sh_pfc_of_table[] = {#endif { }, }; -MODULE_DEVICE_TABLE (of, sh_pfc_of_table);#endif static int sh_pfc_probe (struct platform_device *pdev)
@@ -632,7 +633,6 @@ static const struct platform_device_id sh_pfc_id_table[] = { { "sh-pfc", 0 }, { }, }; -MODULE_DEVICE_TABLE (platform, sh_pfc_id_table);static struct platform_driver sh_pfc_driver = { .probe = sh_pfc_probe,
@@ -649,13 +649,3 @@ static int __init sh_pfc_init(void)return platform_driver_register (&sh_pfc_driver); }postcore_initcall (sh_pfc_init); - -static void __exit sh_pfc_exit(void) -{ -platform_driver_unregister (&sh_pfc_driver); -} -module_exit (sh_pfc_exit); - -MODULE_AUTHOR ("Magnus Damm, Paul Mundt, Laurent Pinchart" ); -MODULE_DESCRIPTION ("Pin Control and GPIO driver for SuperH pin function controller" ); -MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.6.1
Re: [PATCH 4/8] drivers/pinctrl: make sh-pfc/core.c explicitly non-modular
Hi Paul,
Thank you for the patch.
Quoted 22 lines · On Monday 29 February 2016 15:48:40 Paul Gortmaker wrote:
The
Kconfig/Makefilecurrently controlling compilation of this code is:drivers/pinctrl/sh-pfc/Makefile:obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc.o
drivers/pinctrl/sh-pfc/Makefile:sh-pfc-objs = core.o
pinctrl.odrivers/pinctrl/sh-pfc/Kconfig:config
PINCTRL_SH_PFCdrivers/pinctrl/sh-pfc/Kconfig:def_booly...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_initalready wasn't being used in this code, the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information was (or is now) contained at the top of the file in the comments.
Quoted 6 lines
Cc Laurent Pinchart <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Linus Walleij <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Quoted 56 lines
--- drivers/pinctrl/sh-pfc/core.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)drivers/pinctrl/sh-pfc/core.c +4
-13@@ -1,5 +1,7 @@/* -* SuperH Pin Function Controller support. +* Pin Control and GPIO driver for SuperH Pin Function Controller. +* +* Authors: Magnus Damm, Paul Mundt, Laurent Pinchart * * Copyright (C) 2008 Magnus Damm * Copyright (C) 2009 - 2012 Paul Mundt @@ -17,7 +19,7 @@#include <linux/io.h> #include <linux/ioport.h> #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/init.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/pinctrl/machine.h> @@ -503,7 +505,6 @@ static const struct of_device_id sh_pfc_of_table[] = {#endif { }, }; -MODULE_DEVICE_TABLE (of, sh_pfc_of_table);#endif static int sh_pfc_probe (struct platform_device *pdev)@@ -632,7 +633,6 @@ static const struct platform_device_id sh_pfc_id_table[] = { {"sh-pfc" ,0 }, { }, }; -MODULE_DEVICE_TABLE (platform, sh_pfc_id_table); static struct platform_driver sh_pfc_driver = { .probe = sh_pfc_probe,@@ -649,13 +649,3 @@ static int __init sh_pfc_init(void)return platform_driver_register (&sh_pfc_driver); }postcore_initcall (sh_pfc_init); - -static void __exit sh_pfc_exit(void) -{ -platform_driver_unregister (&sh_pfc_driver); -} -module_exit (sh_pfc_exit); - -MODULE_AUTHOR ("Magnus Damm, Paul Mundt, Laurent Pinchart" ); -MODULE_DESCRIPTION("Pin Control and GPIO driver for SuperH pin functioncontroller"); -MODULE_LICENSE("GPL v2");
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 4/8] drivers/pinctrl: make sh-pfc/core.c explicitly non-modular
In reply to Paul GortmakerQuoted 21 lines · Paul Gortmaker
The
Kconfig/Makefilecurrently controlling compilation of this code is:drivers/pinctrl/sh-pfc/Makefile:obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc.o
drivers/pinctrl/sh-pfc/Makefile:sh-pfc-objs = core.o pinctrl.odrivers/pinctrl/sh-pfc/Kconfig:config
PINCTRL_SH_PFCdrivers/pinctrl/sh-pfc/Kconfig:def_booly...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_initalready wasn't being used in this code, the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information was (or is now) contained at the top of the file in the comments.
Quoted 6 lines
Cc Laurent Pinchart <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Linus Walleij <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Linus: Feel free to take this with the other patches from the series. Or do you prefer I queue it up in sh-pfc-for-v4.7?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 4/8] drivers/pinctrl: make sh-pfc/core.c explicitly non-modular
In reply to Paul GortmakerQuoted 21 lines · Paul Gortmaker
The
Kconfig/Makefilecurrently controlling compilation of this code is:drivers/pinctrl/sh-pfc/Makefile:obj-$(CONFIG_PINCTRL_SH_PFC) += sh-pfc.o
drivers/pinctrl/sh-pfc/Makefile:sh-pfc-objs = core.o pinctrl.odrivers/pinctrl/sh-pfc/Kconfig:config
PINCTRL_SH_PFCdrivers/pinctrl/sh-pfc/Kconfig:def_booly...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_initalready wasn't being used in this code, the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information was (or is now) contained at the top of the file in the comments.
Quoted 6 lines
Cc Laurent Pinchart <[email protected]>Cc Geert Uytterhoeven <[email protected]>Cc Linus Walleij <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>
Patch applied with Laurent's and Geert's ACKs.
Yours,
Linus Walleij
PATCH 5/8 drivers/pinctrl: make stm32/pinctrl-stm32f429.c explicitly non-modular
In reply to Paul GortmakerThe Kconfig currently controlling compilation of this code is:
drivers/pinctrl/stm32/Kconfig:config PINCTRL_STM32F429drivers/pinctrl/stm32/Kconfig: bool "STMicroelectronics STM32F429 pin control" if COMPILE_TEST && !MACH_STM32F429
...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 is already contained at the top of the file in the comments.
--- drivers/pinctrl/stm32/pinctrl-stm32f429.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/pinctrl/stm32/pinctrl-stm32f429.c +1 -8
@@ -4,7 +4,6 @@* License terms: GNU General Public License (GPL), version 2 */ #include <linux/init.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/platform_device.h>
@@ -1576,7 +1575,6 @@ static const struct of_device_id stm32f429_pctrl_match[] = { }, { } }; -MODULE_DEVICE_TABLE (of, stm32f429_pctrl_match);static struct platform_driver stm32f429_pinctrl_driver = { .probe = stm32_pctl_probe,
@@ -1590,9 +1588,4 @@ static int __init stm32f429_pinctrl_init(void) {return platform_driver_register (&stm32f429_pinctrl_driver); } - -module_init (stm32f429_pinctrl_init); - -MODULE_LICENSE ("GPL" ); -MODULE_DESCRIPTION ("STM32F429 Pinctrl Driver" ); -MODULE_AUTHOR ("Maxime Coquelin <[email protected]>" ); +device_initcall (stm32f429_pinctrl_init);
Signature · 1 line
2.6.1
Re: [PATCH 5/8] drivers/pinctrl: make stm32/pinctrl-stm32f429.c explicitly non-modular
2016-02-29 21:48 GMT+01:00 Paul Gortmaker <[email protected]>:
Quoted 24 lines
The
Kconfigcurrently controlling compilation of this code is:drivers/pinctrl/stm32/Kconfig:config
PINCTRL_STM32F429drivers/pinctrl/stm32/Kconfig: bool "STMicroelectronics STM32F429 pin control" ifCOMPILE_TEST&& !MACH_STM32F429...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_inittranslates todevice_initcallin the non-modular case, the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.Cc Linus Walleij <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Patrice Chotard <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Paul Gortmaker <[email protected]>
Quoted 3 lines
--- drivers/pinctrl/stm32/pinctrl-stm32f429.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
Thanks for the patch:
Regards,
Maxime
Re: [PATCH 5/8] drivers/pinctrl: make stm32/pinctrl-stm32f429.c explicitly non-modular
In reply to Paul GortmakerQuoted 18 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/pinctrl/stm32/Kconfig:config
PINCTRL_STM32F429drivers/pinctrl/stm32/Kconfig: bool "STMicroelectronics STM32F429 pin control" ifCOMPILE_TEST&& !MACH_STM32F429...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_inittranslates todevice_initcallin the non-modular case, the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 6 lines
Cc Linus Walleij <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Patrice Chotard <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Paul Gortmaker <[email protected]>
Patch applied with Maxime's ACK.
Yours,
Linus Walleij
PATCH 6/8 drivers/pinctrl: make sunxi/pinctrl-sun[4-9]* explicitly non-modular
In reply to Paul GortmakerNone of the Kconfigs for any of these drivers are tristate, meaning that they currently are not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that when reading the drivers there is no doubt they are builtin-only. All drivers get the exact same change, so they are handled in batch.
Changes are (1) use builtin_platform_driver, (2) use init.h header
(3) delete module_exit related code, (4) delete MODULE_DEVICE_TABLE, and (5) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags.
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 etc. tags since all that information is already contained at the top of each file in the comments.
--- drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun5i-a13.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c | 10 ++-------- drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun6i-a31s.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c | 11 ++--------- drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c | 10 ++-------- drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c | 9 ++------- drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c | 9 ++------- 11 files changed, 22 insertions(+), 81 deletions(-)
drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +2 -7
@@ -10,7 +10,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -1035,7 +1035,6 @@ static const struct of_device_id sun4i_a10_pinctrl_match[] = { { .compatible = "allwinner,sun4i-a10-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun4i_a10_pinctrl_match);static struct platform_driver sun4i_a10_pinctrl_driver = { .probe = sun4i_a10_pinctrl_probe,
@@ -1044,8 +1043,4 @@ static struct platform_driver sun4i_a10_pinctrl_driver = { .of_match_table = sun4i_a10_pinctrl_match, }, }; -module_platform_driver (sun4i_a10_pinctrl_driver); - -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A10 pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun4i_a10_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c +2 -7
@@ -10,7 +10,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -674,7 +674,6 @@ static const struct of_device_id sun5i_a10s_pinctrl_match[] = { { .compatible = "allwinner,sun5i-a10s-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun5i_a10s_pinctrl_match);static struct platform_driver sun5i_a10s_pinctrl_driver = { .probe = sun5i_a10s_pinctrl_probe,
@@ -683,8 +682,4 @@ static struct platform_driver sun5i_a10s_pinctrl_driver = { .of_match_table = sun5i_a10s_pinctrl_match, }, }; -module_platform_driver (sun5i_a10s_pinctrl_driver); - -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A10s pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun5i_a10s_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun5i-a13.c +2 -7
@@ -10,7 +10,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -392,7 +392,6 @@ static const struct of_device_id sun5i_a13_pinctrl_match[] = { { .compatible = "allwinner,sun5i-a13-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun5i_a13_pinctrl_match);static struct platform_driver sun5i_a13_pinctrl_driver = { .probe = sun5i_a13_pinctrl_probe,
@@ -401,8 +400,4 @@ static struct platform_driver sun5i_a13_pinctrl_driver = { .of_match_table = sun5i_a13_pinctrl_match, }, }; -module_platform_driver (sun5i_a13_pinctrl_driver); - -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A13 pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun5i_a13_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c +2 -8
@@ -12,7 +12,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -136,7 +136,6 @@ static const struct of_device_id sun6i_a31_r_pinctrl_match[] = { { .compatible = "allwinner,sun6i-a31-r-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun6i_a31_r_pinctrl_match);static struct platform_driver sun6i_a31_r_pinctrl_driver = { .probe = sun6i_a31_r_pinctrl_probe,
@@ -145,9 +144,4 @@ static struct platform_driver sun6i_a31_r_pinctrl_driver = { .of_match_table = sun6i_a31_r_pinctrl_match, }, }; -module_platform_driver (sun6i_a31_r_pinctrl_driver); - -MODULE_AUTHOR ("Boris Brezillon <boris.brezillon at free-electrons.com" ); -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A31 R_PIO pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun6i_a31_r_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c +2 -7
@@ -10,7 +10,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -926,7 +926,6 @@ static const struct of_device_id sun6i_a31_pinctrl_match[] = { { .compatible = "allwinner,sun6i-a31-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun6i_a31_pinctrl_match);static struct platform_driver sun6i_a31_pinctrl_driver = { .probe = sun6i_a31_pinctrl_probe,
@@ -935,8 +934,4 @@ static struct platform_driver sun6i_a31_pinctrl_driver = { .of_match_table = sun6i_a31_pinctrl_match, }, }; -module_platform_driver (sun6i_a31_pinctrl_driver); - -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A31 pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun6i_a31_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun6i-a31s.c +2 -7
@@ -11,7 +11,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -798,7 +798,6 @@ static const struct of_device_id sun6i_a31s_pinctrl_match[] = { { .compatible = "allwinner,sun6i-a31s-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun6i_a31s_pinctrl_match);static struct platform_driver sun6i_a31s_pinctrl_driver = { .probe = sun6i_a31s_pinctrl_probe,
@@ -807,8 +806,4 @@ static struct platform_driver sun6i_a31s_pinctrl_driver = { .of_match_table = sun6i_a31s_pinctrl_match, }, }; -module_platform_driver (sun6i_a31s_pinctrl_driver); - -MODULE_AUTHOR ("Hans de Goede <[email protected]>" ); -MODULE_DESCRIPTION ("Allwinner A31s pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun6i_a31s_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c +2 -7
@@ -10,7 +10,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -1049,7 +1049,6 @@ static const struct of_device_id sun7i_a20_pinctrl_match[] = { { .compatible = "allwinner,sun7i-a20-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun7i_a20_pinctrl_match);static struct platform_driver sun7i_a20_pinctrl_driver = { .probe = sun7i_a20_pinctrl_probe,
@@ -1058,8 +1057,4 @@ static struct platform_driver sun7i_a20_pinctrl_driver = { .of_match_table = sun7i_a20_pinctrl_match, }, }; -module_platform_driver (sun7i_a20_pinctrl_driver); - -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A20 pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun7i_a20_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c +2 -9
@@ -15,7 +15,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -123,7 +123,6 @@ static const struct of_device_id sun8i_a23_r_pinctrl_match[] = { { .compatible = "allwinner,sun8i-a23-r-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun8i_a23_r_pinctrl_match);static struct platform_driver sun8i_a23_r_pinctrl_driver = { .probe = sun8i_a23_r_pinctrl_probe,
@@ -132,10 +131,4 @@ static struct platform_driver sun8i_a23_r_pinctrl_driver = { .of_match_table = sun8i_a23_r_pinctrl_match, }, }; -module_platform_driver (sun8i_a23_r_pinctrl_driver); - -MODULE_AUTHOR ("Chen-Yu Tsai <[email protected]>" ); -MODULE_AUTHOR ("Boris Brezillon <boris.brezillon at free-electrons.com" ); -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A23 R_PIO pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun8i_a23_r_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c +2 -8
@@ -14,7 +14,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -575,7 +575,6 @@ static const struct of_device_id sun8i_a23_pinctrl_match[] = { { .compatible = "allwinner,sun8i-a23-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun8i_a23_pinctrl_match);static struct platform_driver sun8i_a23_pinctrl_driver = { .probe = sun8i_a23_pinctrl_probe,
@@ -584,9 +583,4 @@ static struct platform_driver sun8i_a23_pinctrl_driver = { .of_match_table = sun8i_a23_pinctrl_match, }, }; -module_platform_driver (sun8i_a23_pinctrl_driver); - -MODULE_AUTHOR ("Chen-Yu Tsai <[email protected]>" ); -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A23 pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun8i_a23_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c +2 -7
@@ -12,7 +12,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -497,7 +497,6 @@ static const struct of_device_id sun8i_a33_pinctrl_match[] = { { .compatible = "allwinner,sun8i-a33-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun8i_a33_pinctrl_match);static struct platform_driver sun8i_a33_pinctrl_driver = { .probe = sun8i_a33_pinctrl_probe,
@@ -506,8 +505,4 @@ static struct platform_driver sun8i_a33_pinctrl_driver = { .of_match_table = sun8i_a33_pinctrl_match, }, }; -module_platform_driver (sun8i_a33_pinctrl_driver); - -MODULE_AUTHOR ("Vishnu Patekar <[email protected]>" ); -MODULE_DESCRIPTION ("Allwinner a33 pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun8i_a33_pinctrl_driver);
drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c +2 -7
@@ -10,7 +10,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -733,7 +733,6 @@ static const struct of_device_id sun9i_a80_pinctrl_match[] = { { .compatible = "allwinner,sun9i-a80-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun9i_a80_pinctrl_match);static struct platform_driver sun9i_a80_pinctrl_driver = { .probe = sun9i_a80_pinctrl_probe,
@@ -742,8 +741,4 @@ static struct platform_driver sun9i_a80_pinctrl_driver = { .of_match_table = sun9i_a80_pinctrl_match, }, }; -module_platform_driver (sun9i_a80_pinctrl_driver); - -MODULE_AUTHOR ("Maxime Ripard <[email protected]>" ); -MODULE_DESCRIPTION ("Allwinner A80 pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun9i_a80_pinctrl_driver);
Signature · 1 line
2.6.1
Re: [PATCH 6/8] drivers/pinctrl: make sunxi/pinctrl-sun[4-9]* explicitly non-modular
Quoted 20 lines · Paul Gortmaker
None of the Kconfigs for any of these drivers are tristate, meaning that they currently are not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that when reading the drivers there is no doubt they are builtin-only. All drivers get the exact same change, so they are handled in batch.
Changes are (1) use
builtin_platform_driver, (2) useinit.hheader
(3) deletemodule_exitrelated code, (4) deleteMODULE_DEVICE_TABLE, and (5) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags.Since
module_platform_driver()uses the same init level priority asbuiltin_platform_driver()the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEetc. tags since all that information is already contained at the top of each file in the comments.
Quoted 8 lines
Cc Boris Brezillon <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc Hans de Goede <[email protected]>Cc Maxime Ripard <[email protected]>Cc Vishnu Patekar <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Paul Gortmaker <[email protected]>
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160229/8a9d8149/attachment.sig>
PATCH 7/8 drivers/pinctrl: make sunxi/pinctrl-sun9i-a80-r.c explicitly non-modular
In reply to Paul GortmakerThe Kconfig currently controlling compilation of this code is:
drivers/pinctrl/sunxi/Kconfig:config PINCTRL_SUN9I_A80_R drivers/pinctrl/sunxi/Kconfig: def_bool MACH_SUN9I
...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_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.
--- drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c +2 -7
@@ -9,7 +9,7 @@* warranty of any kind, whether express or implied. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -164,7 +164,6 @@ static const struct of_device_id sun9i_a80_r_pinctrl_match[] = { { .compatible = "allwinner,sun9i-a80-r-pinctrl", }, {} }; -MODULE_DEVICE_TABLE (of, sun9i_a80_r_pinctrl_match);static struct platform_driver sun9i_a80_r_pinctrl_driver = { .probe = sun9i_a80_r_pinctrl_probe,
@@ -174,8 +173,4 @@ static struct platform_driver sun9i_a80_r_pinctrl_driver = { .of_match_table = sun9i_a80_r_pinctrl_match, }, }; -module_platform_driver (sun9i_a80_r_pinctrl_driver); - -MODULE_AUTHOR ("Maxime Ripard <[email protected]" ); -MODULE_DESCRIPTION ("Allwinner A80 R_PIO pinctrl driver" ); -MODULE_LICENSE ("GPL" ); +builtin_platform_driver (sun9i_a80_r_pinctrl_driver);
Signature · 1 line
2.6.1
Re: [PATCH 7/8] drivers/pinctrl: make sunxi/pinctrl-sun9i-a80-r.c explicitly non-modular
Quoted 19 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/pinctrl/sunxi/Kconfig:config
PINCTRL_SUN9I_A80_Rdrivers/pinctrl/sunxi/Kconfig:def_boolMACH_SUN9I...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_platform_driver()uses the same init level priority asbuiltin_platform_driver()the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 6 lines
Cc Linus Walleij <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Paul Gortmaker <[email protected]>
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160229/26b932e5/attachment.sig>
Re: [PATCH 7/8] drivers/pinctrl: make sunxi/pinctrl-sun9i-a80-r.c explicitly non-modular
In reply to Paul GortmakerQuoted 19 lines · Paul Gortmaker
The
Kconfigcurrently controlling compilation of this code is:drivers/pinctrl/sunxi/Kconfig:config
PINCTRL_SUN9I_A80_Rdrivers/pinctrl/sunxi/Kconfig:def_boolMACH_SUN9I...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_platform_driver()uses the same init level priority asbuiltin_platform_driver()the init ordering remains unchanged with this commit.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information is already contained at the top of the file in the comments.
Quoted 6 lines
Cc Linus Walleij <[email protected]>Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Cc linux-gpio at vger.kernel.orgCc linux-arm-kernel at lists.infradead.orgSigned-off-by Paul Gortmaker <[email protected]>
Patch applied with Maxime's ACK.
Yours,
Linus Walleij
PATCH 8/8 drivers/pinctrl: clean up samsung modular vs. non-modular distinctions
In reply to Paul GortmakerFixups here tend to be more all over the map vs. some of the other repeated/systematic ones we've seen elsewhere.
We remove module.h from code that isn't doing anything modular at all; if they have __init sections, then replace it with init.h
A couple drivers have module_exit() code that is essentially orphaned, and so we remove that.
There are no module_init replacements, so we have no concerns wrt. initcall ordering changes as per some of the other cleanups.
Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments.
--- drivers/pinctrl/samsung/pinctrl-exynos.c | 1 - drivers/pinctrl/samsung/pinctrl-exynos5440.c | 15 +++------------ drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-samsung.c | 12 +----------- 5 files changed, 6 insertions(+), 26 deletions(-)
drivers/pinctrl/samsung/pinctrl-exynos.c +0 -1
@@ -18,7 +18,6 @@* external gpio and wakeup interrupt support. */ -#include <linux/module.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h>
drivers/pinctrl/samsung/pinctrl-exynos5440.c +3 -12
@@ -1,6 +1,8 @@/* * pin-controller/pin-mux/pin-config/gpio-driver for Samsung's EXYNOS5440 SoC. * +* Author: Thomas Abraham <[email protected]> +* * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com *
@@ -10,7 +12,7 @@* (at your option) any later version. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/slab.h>
@@ -990,7 +992,6 @@ static const struct of_device_id exynos5440_pinctrl_dt_match[] = { { .compatible = "samsung,exynos5440-pinctrl" }, {}, }; -MODULE_DEVICE_TABLE (of, exynos5440_pinctrl_dt_match);static struct platform_driver exynos5440_pinctrl_driver = { .probe = exynos5440_pinctrl_probe,
@@ -1005,13 +1006,3 @@ static int __init exynos5440_pinctrl_drv_register(void)return platform_driver_register (&exynos5440_pinctrl_driver); }postcore_initcall (exynos5440_pinctrl_drv_register); - -static void __exit exynos5440_pinctrl_drv_unregister(void) -{ -platform_driver_unregister (&exynos5440_pinctrl_driver); -} -module_exit (exynos5440_pinctrl_drv_unregister); - -MODULE_AUTHOR ("Thomas Abraham <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung EXYNOS5440 SoC pinctrl driver" ); -MODULE_LICENSE ("GPL v2" );
drivers/pinctrl/samsung/pinctrl-s3c24xx.c +1 -1
@@ -13,7 +13,7 @@* external gpio and wakeup interrupt support. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h>
drivers/pinctrl/samsung/pinctrl-s3c64xx.c +1 -1
@@ -15,7 +15,7 @@* external gpio and wakeup interrupt support. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/irqdomain.h>
drivers/pinctrl/samsung/pinctrl-samsung.c +1 -11
@@ -20,7 +20,7 @@* and wakeup interrupts can be hooked to. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/slab.h>
@@ -1289,13 +1289,3 @@ static int __init samsung_pinctrl_drv_register(void)return platform_driver_register (&samsung_pinctrl_driver); }postcore_initcall (samsung_pinctrl_drv_register); - -static void __exit samsung_pinctrl_drv_unregister(void) -{ -platform_driver_unregister (&samsung_pinctrl_driver); -} -module_exit (samsung_pinctrl_drv_unregister); - -MODULE_AUTHOR ("Thomas Abraham <[email protected]>" ); -MODULE_DESCRIPTION ("Samsung pinctrl driver" ); -MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.6.1
Re: [PATCH 8/8] drivers/pinctrl: clean up samsung modular vs. non-modular distinctions
Quoted 17 lines · Paul Gortmaker
Fixups here tend to be more all over the map vs. some of the other repeated/systematic ones we've seen elsewhere.
We remove
module.hfrom code that isn't doing anything modular at all; if they have__initsections, then replace it withinit.hA couple drivers have
module_exit()code that is essentially orphaned, and so we remove that.There are no
module_initreplacements, so we have no concerns wrt. initcall ordering changes as per some of the other cleanups.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information was (or is now) contained at the top of the file in the comments.
Quoted 7 lines
Cc Tomasz Figa <[email protected]>Cc Thomas Abraham <[email protected]>Cc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc linux-samsung-soc at vger.kernel.orgCc linux-gpio at vger.kernel.orgSigned-off-by Paul Gortmaker <[email protected]>
This didn't make it in for v4.6 because noone provided ACKs.
Please resend the outstanding (rebased) demodularization patches after v4.6-rc1 and I will merge them no matter if I get ACKs or not, I will not wait for ACKs any longer than that.
Yours,
Linus Walleij
Re: [PATCH 8/8] drivers/pinctrl: clean up samsung modular vs. non-modular distinctions
Quoted 28 lines · [Re: [PATCH 8/8] drivers/pinctrl: clean up samsung modular vs. non-modular…
Quoted 17 lines · Paul Gortmaker
Fixups here tend to be more all over the map vs. some of the other repeated/systematic ones we've seen elsewhere.
We remove
module.hfrom code that isn't doing anything modular at all; if they have__initsections, then replace it withinit.hA couple drivers have
module_exit()code that is essentially orphaned, and so we remove that.There are no
module_initreplacements, so we have no concerns wrt. initcall ordering changes as per some of the other cleanups.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information was (or is now) contained at the top of the file in the comments.Quoted 7 lines
Cc Tomasz Figa <[email protected]>Cc Thomas Abraham <[email protected]>Cc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc linux-samsung-soc at vger.kernel.orgCc linux-gpio at vger.kernel.orgSigned-off-by Paul Gortmaker <[email protected]>
Quoted 5 lines
This didn't make it in for v4.6 because noone provided ACKs.
Please resend the outstanding (rebased) demodularization patches after v4.6-rc1 and I will merge them no matter if I get ACKs or not, I will not wait for ACKs any longer than that.
Sounds good, will do that in ~2 wks.
Thanks,
Paul.
--
Quoted 3 lines
Yours,
Linus Walleij
Re: [PATCH 8/8] drivers/pinctrl: clean up samsung modular vs. non-modular distinctions
In reply to Paul GortmakerQuoted 24 lines · Paul Gortmaker
Fixups here tend to be more all over the map vs. some of the other repeated/systematic ones we've seen elsewhere.
We remove
module.hfrom code that isn't doing anything modular at all; if they have__initsections, then replace it withinit.hA couple drivers have
module_exit()code that is essentially orphaned, and so we remove that.There are no
module_initreplacements, so we have no concerns wrt. initcall ordering changes as per some of the other cleanups.Also note that
MODULE_DEVICE_TABLEis a no-op for non-modular code.We also delete the
MODULE_LICENSEtag etc. since all that information was (or is now) contained at the top of the file in the comments.Cc Tomasz Figa <[email protected]>Cc Thomas Abraham <[email protected]>Cc Linus Walleij <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc linux-samsung-soc at vger.kernel.orgCc linux-gpio at vger.kernel.orgSigned-off-by Paul Gortmaker <[email protected]>
Quoted 7 lines
--- drivers/pinctrl/samsung/pinctrl-exynos.c | 1 - drivers/pinctrl/samsung/pinctrl-exynos5440.c | 15 +++------------ drivers/pinctrl/samsung/pinctrl-s3c24xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 2 +- drivers/pinctrl/samsung/pinctrl-samsung.c | 12 +----------- 5 files changed, 6 insertions(+), 26 deletions(-)
--
Thanks,
Sylwester