Skip to contentSkip to conversation

pinctrl: berlin/mvebu/spear: make bool code non-modular

PATCH In review Paul Gortmaker 4 participants 9 messages Feb 6, 2017 – Feb 13, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover pinctrl: berlin/mvebu/spear: make bool code non-modular

Nothing really new here -- if the Kconfig and/or the Makefile does not allow building the code as modular, then we don't need to be using module_xyz() functions and/or MODULE_XYZ macros.

Here we audit and remove such instances in three subdirectories of the pinctrl subsystem: berlin, mvebu, and spear, which allows us to have a good net removal of unused code as per the diffstat.

Rather than do one commit per driver, we take advantage of the fact that the drivers are grouped already and bundle the changes per family, since the changes are not really deeply technical.

Build tested for allmodconfig on linux-next for arm, arm64, i386 and x86_64.

An automated mapping from the object file to the Makefile and then finally to the Kconfig variable (unless obj-y) and type follows as a double check; run on the current code base in linux-next today.

Paul.
--

drivers/pinctrl/berlin/Makefile:obj-$(CONFIG_PINCTRL_BERLIN_BG2) += berlin-bg2.o drivers/pinctrl/berlin/Kconfig:config PINCTRL_BERLIN_BG2
drivers/pinctrl/berlin/Kconfig: def_bool MACH_BERLIN_BG2

drivers/pinctrl/berlin/Makefile:obj-$(CONFIG_PINCTRL_BERLIN_BG2CD) += berlin-bg2cd.o drivers/pinctrl/berlin/Kconfig:config PINCTRL_BERLIN_BG2CD
drivers/pinctrl/berlin/Kconfig: def_bool MACH_BERLIN_BG2CD

drivers/pinctrl/berlin/Makefile:obj-$(CONFIG_PINCTRL_BERLIN_BG2Q) += berlin-bg2q.o drivers/pinctrl/berlin/Kconfig:config PINCTRL_BERLIN_BG2Q
drivers/pinctrl/berlin/Kconfig: def_bool MACH_BERLIN_BG2Q

drivers/pinctrl/berlin/Makefile:obj-$(CONFIG_PINCTRL_BERLIN_BG4CT) += berlin-bg4ct.o drivers/pinctrl/berlin/Kconfig:config PINCTRL_BERLIN_BG4CT
drivers/pinctrl/berlin/Kconfig: bool "Marvell berlin4ct pin controller driver"

drivers/pinctrl/mvebu/Makefile:obj-$(CONFIG_PINCTRL_ARMADA_370) += pinctrl-armada-370.o drivers/pinctrl/mvebu/Kconfig:config PINCTRL_ARMADA_370
drivers/pinctrl/mvebu/Kconfig: bool

drivers/pinctrl/mvebu/Makefile:obj-$(CONFIG_PINCTRL_ARMADA_375) += pinctrl-armada-375.o drivers/pinctrl/mvebu/Kconfig:config PINCTRL_ARMADA_375
drivers/pinctrl/mvebu/Kconfig: bool

drivers/pinctrl/mvebu/Makefile:obj-$(CONFIG_PINCTRL_ARMADA_38X) += pinctrl-armada-38x.o drivers/pinctrl/mvebu/Kconfig:config PINCTRL_ARMADA_38X
drivers/pinctrl/mvebu/Kconfig: bool

drivers/pinctrl/mvebu/Makefile:obj-$(CONFIG_PINCTRL_ARMADA_39X) += pinctrl-armada-39x.o drivers/pinctrl/mvebu/Kconfig:config PINCTRL_ARMADA_39X
drivers/pinctrl/mvebu/Kconfig: bool

drivers/pinctrl/mvebu/Makefile:obj-$(CONFIG_PINCTRL_ARMADA_XP) += pinctrl-armada-xp.o drivers/pinctrl/mvebu/Kconfig:config PINCTRL_ARMADA_XP
drivers/pinctrl/mvebu/Kconfig: bool

drivers/pinctrl/mvebu/Makefile:obj-$(CONFIG_PINCTRL_DOVE) += pinctrl-dove.o drivers/pinctrl/mvebu/Kconfig:config PINCTRL_DOVE
drivers/pinctrl/mvebu/Kconfig: bool

drivers/pinctrl/mvebu/Makefile:obj-$(CONFIG_PINCTRL_KIRKWOOD) += pinctrl-kirkwood.o drivers/pinctrl/mvebu/Kconfig:config PINCTRL_KIRKWOOD
drivers/pinctrl/mvebu/Kconfig: bool

drivers/pinctrl/mvebu/Makefile:obj-y += pinctrl-mvebu.o

drivers/pinctrl/mvebu/Makefile:obj-$(CONFIG_PINCTRL_ORION) += pinctrl-orion.o drivers/pinctrl/mvebu/Kconfig:config PINCTRL_ORION
drivers/pinctrl/mvebu/Kconfig: bool

drivers/pinctrl/spear/Makefile:obj-$(CONFIG_PINCTRL_SPEAR_PLGPIO) += pinctrl-plgpio.o drivers/pinctrl/spear/Kconfig:config PINCTRL_SPEAR_PLGPIO
drivers/pinctrl/spear/Kconfig: bool "SPEAr SoC PLGPIO Controller"

drivers/pinctrl/spear/Makefile:obj-$(CONFIG_PINCTRL_SPEAR1310) += pinctrl-spear1310.o drivers/pinctrl/spear/Kconfig:config PINCTRL_SPEAR1310
drivers/pinctrl/spear/Kconfig: bool "ST Microelectronics SPEAr1310 SoC pin controller driver"

drivers/pinctrl/spear/Makefile:obj-$(CONFIG_PINCTRL_SPEAR1340) += pinctrl-spear1340.o drivers/pinctrl/spear/Kconfig:config PINCTRL_SPEAR1340
drivers/pinctrl/spear/Kconfig: bool "ST Microelectronics SPEAr1340 SoC pin controller driver"

drivers/pinctrl/spear/Makefile:obj-$(CONFIG_PINCTRL_SPEAR300) += pinctrl-spear300.o drivers/pinctrl/spear/Kconfig:config PINCTRL_SPEAR300
drivers/pinctrl/spear/Kconfig: bool "ST Microelectronics SPEAr300 SoC pin controller driver"

drivers/pinctrl/spear/Makefile:obj-$(CONFIG_PINCTRL_SPEAR310) += pinctrl-spear310.o drivers/pinctrl/spear/Kconfig:config PINCTRL_SPEAR310
drivers/pinctrl/spear/Kconfig: bool "ST Microelectronics SPEAr310 SoC pin controller driver"

drivers/pinctrl/spear/Makefile:obj-$(CONFIG_PINCTRL_SPEAR320) += pinctrl-spear320.o drivers/pinctrl/spear/Kconfig:config PINCTRL_SPEAR320
drivers/pinctrl/spear/Kconfig: bool "ST Microelectronics SPEAr320 SoC pin controller driver"

---

Cc "Antoine Ténart" <[email protected]>
Cc Hongzhou Yang <[email protected]>
Cc Jisheng Zhang <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc Sebastian Hesselbarth <[email protected]>
Cc Thomas Hebb <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Viresh Kumar <[email protected]>

Paul Gortmaker (3):
pinctrl: mvebu: make bool drivers explicitly non-modular
pinctrl: spear: make bool drivers explicitly non-modular
pinctrl: berlin: make bool drivers explicitly non-modular

 drivers/pinctrl/berlin/berlin-bg2.c        |  9 ++-------
 drivers/pinctrl/berlin/berlin-bg2cd.c      |  9 ++-------
 drivers/pinctrl/berlin/berlin-bg2q.c       |  9 ++-------
 drivers/pinctrl/berlin/berlin-bg4ct.c      |  9 ++-------
 drivers/pinctrl/mvebu/pinctrl-armada-370.c |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-375.c |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-38x.c |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-39x.c |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-xp.c  |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-dove.c       | 17 ++---------------
 drivers/pinctrl/mvebu/pinctrl-kirkwood.c   |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-mvebu.c      |  1 -
 drivers/pinctrl/mvebu/pinctrl-orion.c      |  8 +-------
 drivers/pinctrl/spear/pinctrl-plgpio.c     |  7 +------
 drivers/pinctrl/spear/pinctrl-spear1310.c  | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear1340.c  | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear300.c   | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear310.c   | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear320.c   | 12 ------------
 19 files changed, 18 insertions(+), 159 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/3 pinctrl: mvebu: make bool drivers explicitly non-modular

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) dont use module.h
(3) delete module_exit related code, (4) delete MODULE_DEVICE_TABLE, and (5) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags.

For the dove driver 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.

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

---
 drivers/pinctrl/mvebu/pinctrl-armada-370.c |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-375.c |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-38x.c |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-39x.c |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-armada-xp.c  |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-dove.c       | 17 ++---------------
 drivers/pinctrl/mvebu/pinctrl-kirkwood.c   |  8 +-------
 drivers/pinctrl/mvebu/pinctrl-mvebu.c      |  1 -
 drivers/pinctrl/mvebu/pinctrl-orion.c      |  8 +-------
 9 files changed, 9 insertions(+), 65 deletions(-)
drivers/pinctrl/mvebu/pinctrl-armada-370.c +1 -7
index c2de4f8ee488..9feba9a5ccb7 100644
@@ -14,7 +14,6 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
@@ -406,9 +405,4 @@ static struct platform_driver armada_370_pinctrl_driver = {
 	},
 	.probe = armada_370_pinctrl_probe,
 };
-
-module_platform_driver(armada_370_pinctrl_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_DESCRIPTION("Marvell Armada 370 pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_370_pinctrl_driver);
drivers/pinctrl/mvebu/pinctrl-armada-375.c +1 -7
index 30cbf23b0b03..b7de8abccd48 100644
@@ -14,7 +14,6 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
@@ -424,9 +423,4 @@ static struct platform_driver armada_375_pinctrl_driver = {
 	},
 	.probe = armada_375_pinctrl_probe,
 };
-
-module_platform_driver(armada_375_pinctrl_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_DESCRIPTION("Marvell Armada 375 pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_375_pinctrl_driver);
drivers/pinctrl/mvebu/pinctrl-armada-38x.c +1 -7
index e66ed239522e..de2e1538a26f 100644
@@ -14,7 +14,6 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -435,9 +434,4 @@ static struct platform_driver armada_38x_pinctrl_driver = {
 	},
 	.probe = armada_38x_pinctrl_probe,
 };
-
-module_platform_driver(armada_38x_pinctrl_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_DESCRIPTION("Marvell Armada 38x pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_38x_pinctrl_driver);
drivers/pinctrl/mvebu/pinctrl-armada-39x.c +1 -7
index 697c8774a4da..627f57c88372 100644
@@ -14,7 +14,6 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -417,9 +416,4 @@ static struct platform_driver armada_39x_pinctrl_driver = {
 	},
 	.probe = armada_39x_pinctrl_probe,
 };
-
-module_platform_driver(armada_39x_pinctrl_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_DESCRIPTION("Marvell Armada 39x pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_39x_pinctrl_driver);
drivers/pinctrl/mvebu/pinctrl-armada-xp.c +1 -7
index 61cbc138703e..b854f1ee5de5 100644
@@ -20,7 +20,6 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
@@ -650,9 +649,4 @@ static struct platform_driver armada_xp_pinctrl_driver = {
 	.suspend = armada_xp_pinctrl_suspend,
 	.resume = armada_xp_pinctrl_resume,
 };
-
-module_platform_driver(armada_xp_pinctrl_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_DESCRIPTION("Marvell Armada XP pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_xp_pinctrl_driver);
drivers/pinctrl/mvebu/pinctrl-dove.c +2 -15
index 89ae93c49f2f..8472f61f2bbe 100644
@@ -12,7 +12,6 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/bitops.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
@@ -854,24 +853,12 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
 	return mvebu_pinctrl_probe(pdev);
 }
 
-static int dove_pinctrl_remove(struct platform_device *pdev)
-{
-	if (!IS_ERR(clk))
-		clk_disable_unprepare(clk);
-	return 0;
-}
-
 static struct platform_driver dove_pinctrl_driver = {
 	.driver = {
 		.name = "dove-pinctrl",
+		.suppress_bind_attrs = true,
 		.of_match_table = dove_pinctrl_of_match,
 	},
 	.probe = dove_pinctrl_probe,
-	.remove = dove_pinctrl_remove,
 };
-
-module_platform_driver(dove_pinctrl_driver);
-
-MODULE_AUTHOR("Sebastian Hesselbarth <[email protected]>");
-MODULE_DESCRIPTION("Marvell Dove pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(dove_pinctrl_driver);
drivers/pinctrl/mvebu/pinctrl-kirkwood.c +1 -7
index be12b6d569a0..5995a19abde5 100644
@@ -12,7 +12,6 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
@@ -472,9 +471,4 @@ static struct platform_driver kirkwood_pinctrl_driver = {
 	},
 	.probe = kirkwood_pinctrl_probe,
 };
-
-module_platform_driver(kirkwood_pinctrl_driver);
-
-MODULE_AUTHOR("Sebastian Hesselbarth <[email protected]>");
-MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(kirkwood_pinctrl_driver);
drivers/pinctrl/mvebu/pinctrl-mvebu.c +0 -1
index 1bdfe770eb5c..e4dda12d371a 100644
@@ -11,7 +11,6 @@
  */
 
 #include <linux/platform_device.h>
-#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/io.h>
 #include <linux/of.h>
drivers/pinctrl/mvebu/pinctrl-orion.c +1 -7
index c2e0c16cf9b3..69cb4d9f0114 100644
@@ -20,7 +20,6 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
@@ -249,9 +248,4 @@ static struct platform_driver orion_pinctrl_driver = {
 	},
 	.probe = orion_pinctrl_probe,
 };
-
-module_platform_driver(orion_pinctrl_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <[email protected]>");
-MODULE_DESCRIPTION("Marvell Orion pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(orion_pinctrl_driver);
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 1/3] pinctrl: mvebu: make bool drivers explicitly non-modular

Quoted 19 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) dont use module.h
(3) delete module_exit related code, (4) delete MODULE_DEVICE_TABLE, and (5) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags.

For the dove driver 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.

Quoted 7 lines

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

Patch applied.

Yours,
Linus Walleij

#3 lore raw

PATCH 2/3 pinctrl: spear: make bool drivers explicitly non-modular

In reply to 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 init.h header in place of module.h header,
(2) delete module_exit related code, (3) delete MODULE_DEVICE_TABLE, and (4) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags.

None of these drivers were using module_init() so we don't have to worry about the init ordering getting changed 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/spear/pinctrl-plgpio.c    |  7 +------
 drivers/pinctrl/spear/pinctrl-spear1310.c | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear1340.c | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear300.c  | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear310.c  | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear320.c  | 12 ------------
 6 files changed, 1 insertion(+), 66 deletions(-)
drivers/pinctrl/spear/pinctrl-plgpio.c +1 -6
index 4c9b863f8267..cf6d68c7345b 100644
@@ -13,7 +13,7 @@
 #include <linux/err.h>
 #include <linux/gpio/driver.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/pinctrl/consumer.h>
@@ -705,7 +705,6 @@ static const struct of_device_id plgpio_of_match[] = {
 	{ .compatible = "st,spear-plgpio" },
 	{}
 };
-MODULE_DEVICE_TABLE(of, plgpio_of_match);
 
 static struct platform_driver plgpio_driver = {
 	.probe = plgpio_probe,
@@ -721,7 +720,3 @@ static int __init plgpio_init(void)
 	return platform_driver_register(&plgpio_driver);
 }
 subsys_initcall(plgpio_init);
-
-MODULE_AUTHOR("Viresh Kumar <[email protected]>");
-MODULE_DESCRIPTION("STMicroelectronics SPEAr PLGPIO driver");
-MODULE_LICENSE("GPL");
drivers/pinctrl/spear/pinctrl-spear1310.c +0 -12
index 18210681c737..0180eb544f02 100644
@@ -11,7 +11,6 @@
 
 #include <linux/err.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include "pinctrl-spear.h"
@@ -2717,14 +2716,3 @@ static int __init spear1310_pinctrl_init(void)
 	return platform_driver_register(&spear1310_pinctrl_driver);
 }
 arch_initcall(spear1310_pinctrl_init);
-
-static void __exit spear1310_pinctrl_exit(void)
-{
-	platform_driver_unregister(&spear1310_pinctrl_driver);
-}
-module_exit(spear1310_pinctrl_exit);
-
-MODULE_AUTHOR("Viresh Kumar <[email protected]>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear1340.c +0 -12
index c01fb23ee636..0ca961219b3b 100644
@@ -11,7 +11,6 @@
 
 #include <linux/err.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include "pinctrl-spear.h"
@@ -2033,14 +2032,3 @@ static int __init spear1340_pinctrl_init(void)
 	return platform_driver_register(&spear1340_pinctrl_driver);
 }
 arch_initcall(spear1340_pinctrl_init);
-
-static void __exit spear1340_pinctrl_exit(void)
-{
-	platform_driver_unregister(&spear1340_pinctrl_driver);
-}
-module_exit(spear1340_pinctrl_exit);
-
-MODULE_AUTHOR("Viresh Kumar <[email protected]>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear300.c +0 -12
index 111148daa3f1..e39913a18139 100644
@@ -11,7 +11,6 @@
 
 #include <linux/err.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include "pinctrl-spear3xx.h"
@@ -690,14 +689,3 @@ static int __init spear300_pinctrl_init(void)
 	return platform_driver_register(&spear300_pinctrl_driver);
 }
 arch_initcall(spear300_pinctrl_init);
-
-static void __exit spear300_pinctrl_exit(void)
-{
-	platform_driver_unregister(&spear300_pinctrl_driver);
-}
-module_exit(spear300_pinctrl_exit);
-
-MODULE_AUTHOR("Viresh Kumar <[email protected]>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear310.c +0 -12
index a7b000062985..393b2b97d527 100644
@@ -11,7 +11,6 @@
 
 #include <linux/err.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include "pinctrl-spear3xx.h"
@@ -413,14 +412,3 @@ static int __init spear310_pinctrl_init(void)
 	return platform_driver_register(&spear310_pinctrl_driver);
 }
 arch_initcall(spear310_pinctrl_init);
-
-static void __exit spear310_pinctrl_exit(void)
-{
-	platform_driver_unregister(&spear310_pinctrl_driver);
-}
-module_exit(spear310_pinctrl_exit);
-
-MODULE_AUTHOR("Viresh Kumar <[email protected]>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear310_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear320.c +0 -12
index e2b3817701dc..99c10fc3d9b5 100644
@@ -11,7 +11,6 @@
 
 #include <linux/err.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include "pinctrl-spear3xx.h"
@@ -3454,14 +3453,3 @@ static int __init spear320_pinctrl_init(void)
 	return platform_driver_register(&spear320_pinctrl_driver);
 }
 arch_initcall(spear320_pinctrl_init);
-
-static void __exit spear320_pinctrl_exit(void)
-{
-	platform_driver_unregister(&spear320_pinctrl_driver);
-}
-module_exit(spear320_pinctrl_exit);
-
-MODULE_AUTHOR("Viresh Kumar <[email protected]>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match);
Signature · 1 line
2.11.0
Acked-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] pinctrl: spear: make bool drivers explicitly non-modular

Quoted 24 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 init.h header in place of module.h header,
(2) delete module_exit related code, (3) delete MODULE_DEVICE_TABLE, and (4) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags.

None of these drivers were using module_init() so we don't have to worry about the init ordering getting changed 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.

Quoted 8 lines
---
 drivers/pinctrl/spear/pinctrl-plgpio.c    |  7 +------
 drivers/pinctrl/spear/pinctrl-spear1310.c | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear1340.c | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear300.c  | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear310.c  | 12 ------------
 drivers/pinctrl/spear/pinctrl-spear320.c  | 12 ------------
 6 files changed, 1 insertion(+), 66 deletions(-)
Signature · 1 line
viresh
#5 lore raw

Re: [PATCH 2/3] pinctrl: spear: make bool drivers explicitly non-modular

In reply to Paul Gortmaker
Quoted 16 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 init.h header in place of module.h header,
(2) delete module_exit related code, (3) delete MODULE_DEVICE_TABLE, and (4) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags.

None of these drivers were using module_init() so we don't have to worry about the init ordering getting changed with this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Quoted 8 lines

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

Patch applied.

Yours,
Linus Walleij

#6 lore raw

PATCH 3/3 pinctrl: berlin: make bool drivers explicitly non-modular

In reply to 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 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.

Cc Linus Walleij <[email protected]>
Cc "Antoine Ténart" <[email protected]>
Cc Sebastian Hesselbarth <[email protected]>
Cc Jisheng Zhang <[email protected]>
Cc Hongzhou Yang <[email protected]>
Cc Thomas Hebb <[email protected]>
Cc Masahiro Yamada <[email protected]>
---
 drivers/pinctrl/berlin/berlin-bg2.c   | 9 ++-------
 drivers/pinctrl/berlin/berlin-bg2cd.c | 9 ++-------
 drivers/pinctrl/berlin/berlin-bg2q.c  | 9 ++-------
 drivers/pinctrl/berlin/berlin-bg4ct.c | 9 ++-------
 4 files changed, 8 insertions(+), 28 deletions(-)
drivers/pinctrl/berlin/berlin-bg2.c +2 -7
index fabe728ae268..bf2e17d0d6e4 100644
@@ -10,7 +10,7 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
@@ -227,7 +227,6 @@ static const struct of_device_id berlin2_pinctrl_match[] = {
 	},
 	{}
 };
-MODULE_DEVICE_TABLE(of, berlin2_pinctrl_match);
 
 static int berlin2_pinctrl_probe(struct platform_device *pdev)
 {
@@ -244,8 +243,4 @@ static struct platform_driver berlin2_pinctrl_driver = {
 		.of_match_table = berlin2_pinctrl_match,
 	},
 };
-module_platform_driver(berlin2_pinctrl_driver);
-
-MODULE_AUTHOR("Antoine Ténart <[email protected]>");
-MODULE_DESCRIPTION("Marvell Berlin BG2 pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2_pinctrl_driver);
drivers/pinctrl/berlin/berlin-bg2cd.c +2 -7
index ad8c75861373..9bee7bd1650f 100644
@@ -10,7 +10,7 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
@@ -172,7 +172,6 @@ static const struct of_device_id berlin2cd_pinctrl_match[] = {
 	},
 	{}
 };
-MODULE_DEVICE_TABLE(of, berlin2cd_pinctrl_match);
 
 static int berlin2cd_pinctrl_probe(struct platform_device *pdev)
 {
@@ -189,8 +188,4 @@ static struct platform_driver berlin2cd_pinctrl_driver = {
 		.of_match_table = berlin2cd_pinctrl_match,
 	},
 };
-module_platform_driver(berlin2cd_pinctrl_driver);
-
-MODULE_AUTHOR("Antoine Ténart <[email protected]>");
-MODULE_DESCRIPTION("Marvell Berlin BG2CD pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2cd_pinctrl_driver);
drivers/pinctrl/berlin/berlin-bg2q.c +2 -7
index cd171aea8ca8..eee6763f114c 100644
@@ -10,7 +10,7 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
@@ -389,7 +389,6 @@ static const struct of_device_id berlin2q_pinctrl_match[] = {
 	},
 	{}
 };
-MODULE_DEVICE_TABLE(of, berlin2q_pinctrl_match);
 
 static int berlin2q_pinctrl_probe(struct platform_device *pdev)
 {
@@ -406,8 +405,4 @@ static struct platform_driver berlin2q_pinctrl_driver = {
 		.of_match_table = berlin2q_pinctrl_match,
 	},
 };
-module_platform_driver(berlin2q_pinctrl_driver);
-
-MODULE_AUTHOR("Antoine Ténart <[email protected]>");
-MODULE_DESCRIPTION("Marvell Berlin BG2Q pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2q_pinctrl_driver);
drivers/pinctrl/berlin/berlin-bg4ct.c +2 -7
index c617ec49e9ed..e6740656ee7c 100644
@@ -18,7 +18,7 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
@@ -457,7 +457,6 @@ static const struct of_device_id berlin4ct_pinctrl_match[] = {
 	},
 	{}
 };
-MODULE_DEVICE_TABLE(of, berlin4ct_pinctrl_match);
 
 static int berlin4ct_pinctrl_probe(struct platform_device *pdev)
 {
@@ -496,8 +495,4 @@ static struct platform_driver berlin4ct_pinctrl_driver = {
 		.of_match_table = berlin4ct_pinctrl_match,
 	},
 };
-module_platform_driver(berlin4ct_pinctrl_driver);
-
-MODULE_AUTHOR("Jisheng Zhang <[email protected]>");
-MODULE_DESCRIPTION("Marvell berlin4ct pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin4ct_pinctrl_driver);
Signature · 1 line
2.11.0
Acked-by on v1 3/3
#7 lore raw

Re: [PATCH 3/3] pinctrl: berlin: make bool drivers explicitly non-modular

Quoted 15 lines · On Mon, 6 Feb 2017 03:03:52 -0500 Paul Gortmaker wrote:

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

Quoted 9 lines
Cc Linus Walleij <[email protected]>
Cc "Antoine Ténart" <[email protected]>
Cc Sebastian Hesselbarth <[email protected]>
Cc Jisheng Zhang <[email protected]>
Cc Hongzhou Yang <[email protected]>
Cc Thomas Hebb <[email protected]>
Cc Masahiro Yamada <[email protected]>
#8 lore raw

Re: [PATCH 3/3] pinctrl: berlin: make bool drivers explicitly non-modular

In reply to Paul Gortmaker
Quoted 15 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 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.

Quoted 9 lines
Cc Linus Walleij <[email protected]>
Cc "Antoine Ténart" <[email protected]>
Cc Sebastian Hesselbarth <[email protected]>
Cc Jisheng Zhang <[email protected]>
Cc Hongzhou Yang <[email protected]>
Cc Thomas Hebb <[email protected]>
Cc Masahiro Yamada <[email protected]>

Patch applied.

Yours,
Linus Walleij