All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] pinctrl: berlin/mvebu/spear: make bool code non-modular
@ 2017-02-06  8:03 ` Paul Gortmaker
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2017-02-06  8:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Antoine Ténart, Hongzhou Yang,
	Jisheng Zhang, Linus Walleij, Masahiro Yamada,
	Sebastian Hesselbarth, Thomas Hebb, Thomas Petazzoni,
	Viresh Kumar, spear-devel, linux-gpio

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" <antoine.tenart@free-electrons.com>
Cc: Hongzhou Yang <hongzhou.yang@mediatek.com>
Cc: Jisheng Zhang <jszhang@marvell.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Thomas Hebb <tommyhebb@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Viresh Kumar <vireshk@kernel.org>
Cc: spear-devel@list.st.com
Cc: linux-gpio@vger.kernel.org

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

-- 
2.11.0

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

* [PATCH 0/3] pinctrl: berlin/mvebu/spear: make bool code non-modular
@ 2017-02-06  8:03 ` Paul Gortmaker
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2017-02-06  8:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Antoine Ténart, Hongzhou Yang,
	Jisheng Zhang, Linus Walleij, Masahiro Yamada,
	Sebastian Hesselbarth, Thomas Hebb, Thomas Petazzoni,
	Viresh Kumar, spear-devel, linux-gpio

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" <antoine.tenart@free-electrons.com>
Cc: Hongzhou Yang <hongzhou.yang@mediatek.com>
Cc: Jisheng Zhang <jszhang@marvell.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Thomas Hebb <tommyhebb@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Viresh Kumar <vireshk@kernel.org>
Cc: spear-devel@list.st.com
Cc: linux-gpio@vger.kernel.org

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

-- 
2.11.0

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

* [PATCH 1/3] pinctrl: mvebu: make bool drivers explicitly non-modular
  2017-02-06  8:03 ` Paul Gortmaker
@ 2017-02-06  8:03   ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2017-02-06  8:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Linus Walleij, Thomas Petazzoni, linux-gpio

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.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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(-)

diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-370.c b/drivers/pinctrl/mvebu/pinctrl-armada-370.c
index c2de4f8ee488..9feba9a5ccb7 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-370.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-370.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada 370 pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_370_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-375.c b/drivers/pinctrl/mvebu/pinctrl-armada-375.c
index 30cbf23b0b03..b7de8abccd48 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-375.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-375.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada 375 pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_375_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-38x.c b/drivers/pinctrl/mvebu/pinctrl-armada-38x.c
index e66ed239522e..de2e1538a26f 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-38x.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-38x.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada 38x pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_38x_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-39x.c b/drivers/pinctrl/mvebu/pinctrl-armada-39x.c
index 697c8774a4da..627f57c88372 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-39x.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-39x.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada 39x pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_39x_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
index 61cbc138703e..b854f1ee5de5 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada XP pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_xp_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index 89ae93c49f2f..8472f61f2bbe 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -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 <sebastian.hesselbarth@gmail.com>");
-MODULE_DESCRIPTION("Marvell Dove pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(dove_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-kirkwood.c b/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
index be12b6d569a0..5995a19abde5 100644
--- a/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
+++ b/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
@@ -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 <sebastian.hesselbarth@gmail.com>");
-MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(kirkwood_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
index 1bdfe770eb5c..e4dda12d371a 100644
--- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c
+++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
@@ -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>
diff --git a/drivers/pinctrl/mvebu/pinctrl-orion.c b/drivers/pinctrl/mvebu/pinctrl-orion.c
index c2e0c16cf9b3..69cb4d9f0114 100644
--- a/drivers/pinctrl/mvebu/pinctrl-orion.c
+++ b/drivers/pinctrl/mvebu/pinctrl-orion.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Orion pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(orion_pinctrl_driver);
-- 
2.11.0

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

* [PATCH 1/3] pinctrl: mvebu: make bool drivers explicitly non-modular
@ 2017-02-06  8:03   ` Paul Gortmaker
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2017-02-06  8:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Linus Walleij, Thomas Petazzoni, linux-gpio

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.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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(-)

diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-370.c b/drivers/pinctrl/mvebu/pinctrl-armada-370.c
index c2de4f8ee488..9feba9a5ccb7 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-370.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-370.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada 370 pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_370_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-375.c b/drivers/pinctrl/mvebu/pinctrl-armada-375.c
index 30cbf23b0b03..b7de8abccd48 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-375.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-375.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada 375 pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_375_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-38x.c b/drivers/pinctrl/mvebu/pinctrl-armada-38x.c
index e66ed239522e..de2e1538a26f 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-38x.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-38x.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada 38x pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_38x_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-39x.c b/drivers/pinctrl/mvebu/pinctrl-armada-39x.c
index 697c8774a4da..627f57c88372 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-39x.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-39x.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada 39x pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_39x_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
index 61cbc138703e..b854f1ee5de5 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Armada XP pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(armada_xp_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index 89ae93c49f2f..8472f61f2bbe 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -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 <sebastian.hesselbarth@gmail.com>");
-MODULE_DESCRIPTION("Marvell Dove pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(dove_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-kirkwood.c b/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
index be12b6d569a0..5995a19abde5 100644
--- a/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
+++ b/drivers/pinctrl/mvebu/pinctrl-kirkwood.c
@@ -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 <sebastian.hesselbarth@gmail.com>");
-MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(kirkwood_pinctrl_driver);
diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
index 1bdfe770eb5c..e4dda12d371a 100644
--- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c
+++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
@@ -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>
diff --git a/drivers/pinctrl/mvebu/pinctrl-orion.c b/drivers/pinctrl/mvebu/pinctrl-orion.c
index c2e0c16cf9b3..69cb4d9f0114 100644
--- a/drivers/pinctrl/mvebu/pinctrl-orion.c
+++ b/drivers/pinctrl/mvebu/pinctrl-orion.c
@@ -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 <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Orion pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(orion_pinctrl_driver);
-- 
2.11.0

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

* [PATCH 2/3] pinctrl: spear: make bool drivers explicitly non-modular
  2017-02-06  8:03 ` Paul Gortmaker
@ 2017-02-06  8:03   ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2017-02-06  8:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Viresh Kumar, Linus Walleij, spear-devel, linux-gpio

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.

Cc: Viresh Kumar <vireshk@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: spear-devel@list.st.com
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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(-)

diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 4c9b863f8267..cf6d68c7345b 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -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 <viresh.kumar@linaro.org>");
-MODULE_DESCRIPTION("STMicroelectronics SPEAr PLGPIO driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/pinctrl/spear/pinctrl-spear1310.c b/drivers/pinctrl/spear/pinctrl-spear1310.c
index 18210681c737..0180eb544f02 100644
--- a/drivers/pinctrl/spear/pinctrl-spear1310.c
+++ b/drivers/pinctrl/spear/pinctrl-spear1310.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear1340.c b/drivers/pinctrl/spear/pinctrl-spear1340.c
index c01fb23ee636..0ca961219b3b 100644
--- a/drivers/pinctrl/spear/pinctrl-spear1340.c
+++ b/drivers/pinctrl/spear/pinctrl-spear1340.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear300.c b/drivers/pinctrl/spear/pinctrl-spear300.c
index 111148daa3f1..e39913a18139 100644
--- a/drivers/pinctrl/spear/pinctrl-spear300.c
+++ b/drivers/pinctrl/spear/pinctrl-spear300.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear310.c b/drivers/pinctrl/spear/pinctrl-spear310.c
index a7b000062985..393b2b97d527 100644
--- a/drivers/pinctrl/spear/pinctrl-spear310.c
+++ b/drivers/pinctrl/spear/pinctrl-spear310.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear310_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear320.c b/drivers/pinctrl/spear/pinctrl-spear320.c
index e2b3817701dc..99c10fc3d9b5 100644
--- a/drivers/pinctrl/spear/pinctrl-spear320.c
+++ b/drivers/pinctrl/spear/pinctrl-spear320.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match);
-- 
2.11.0

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

* [PATCH 2/3] pinctrl: spear: make bool drivers explicitly non-modular
@ 2017-02-06  8:03   ` Paul Gortmaker
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2017-02-06  8:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Viresh Kumar, Linus Walleij, spear-devel, linux-gpio

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.

Cc: Viresh Kumar <vireshk@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: spear-devel@list.st.com
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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(-)

diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 4c9b863f8267..cf6d68c7345b 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -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 <viresh.kumar@linaro.org>");
-MODULE_DESCRIPTION("STMicroelectronics SPEAr PLGPIO driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/pinctrl/spear/pinctrl-spear1310.c b/drivers/pinctrl/spear/pinctrl-spear1310.c
index 18210681c737..0180eb544f02 100644
--- a/drivers/pinctrl/spear/pinctrl-spear1310.c
+++ b/drivers/pinctrl/spear/pinctrl-spear1310.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear1340.c b/drivers/pinctrl/spear/pinctrl-spear1340.c
index c01fb23ee636..0ca961219b3b 100644
--- a/drivers/pinctrl/spear/pinctrl-spear1340.c
+++ b/drivers/pinctrl/spear/pinctrl-spear1340.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear300.c b/drivers/pinctrl/spear/pinctrl-spear300.c
index 111148daa3f1..e39913a18139 100644
--- a/drivers/pinctrl/spear/pinctrl-spear300.c
+++ b/drivers/pinctrl/spear/pinctrl-spear300.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear310.c b/drivers/pinctrl/spear/pinctrl-spear310.c
index a7b000062985..393b2b97d527 100644
--- a/drivers/pinctrl/spear/pinctrl-spear310.c
+++ b/drivers/pinctrl/spear/pinctrl-spear310.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear310_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear320.c b/drivers/pinctrl/spear/pinctrl-spear320.c
index e2b3817701dc..99c10fc3d9b5 100644
--- a/drivers/pinctrl/spear/pinctrl-spear320.c
+++ b/drivers/pinctrl/spear/pinctrl-spear320.c
@@ -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 <vireshk@kernel.org>");
-MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match);
-- 
2.11.0

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

* [PATCH 3/3] pinctrl: berlin: make bool drivers explicitly non-modular
  2017-02-06  8:03 ` Paul Gortmaker
@ 2017-02-06  8:03   ` Paul Gortmaker
  -1 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2017-02-06  8:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Linus Walleij, Antoine Ténart,
	Sebastian Hesselbarth, Jisheng Zhang, Hongzhou Yang, Thomas Hebb,
	Masahiro Yamada, linux-gpio

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 <linus.walleij@linaro.org>
Cc: "Antoine Ténart" <antoine.tenart@free-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Jisheng Zhang <jszhang@marvell.com>
Cc: Hongzhou Yang <hongzhou.yang@mediatek.com>
Cc: Thomas Hebb <tommyhebb@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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(-)

diff --git a/drivers/pinctrl/berlin/berlin-bg2.c b/drivers/pinctrl/berlin/berlin-bg2.c
index fabe728ae268..bf2e17d0d6e4 100644
--- a/drivers/pinctrl/berlin/berlin-bg2.c
+++ b/drivers/pinctrl/berlin/berlin-bg2.c
@@ -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 <antoine.tenart@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Berlin BG2 pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2_pinctrl_driver);
diff --git a/drivers/pinctrl/berlin/berlin-bg2cd.c b/drivers/pinctrl/berlin/berlin-bg2cd.c
index ad8c75861373..9bee7bd1650f 100644
--- a/drivers/pinctrl/berlin/berlin-bg2cd.c
+++ b/drivers/pinctrl/berlin/berlin-bg2cd.c
@@ -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 <antoine.tenart@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Berlin BG2CD pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2cd_pinctrl_driver);
diff --git a/drivers/pinctrl/berlin/berlin-bg2q.c b/drivers/pinctrl/berlin/berlin-bg2q.c
index cd171aea8ca8..eee6763f114c 100644
--- a/drivers/pinctrl/berlin/berlin-bg2q.c
+++ b/drivers/pinctrl/berlin/berlin-bg2q.c
@@ -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 <antoine.tenart@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Berlin BG2Q pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2q_pinctrl_driver);
diff --git a/drivers/pinctrl/berlin/berlin-bg4ct.c b/drivers/pinctrl/berlin/berlin-bg4ct.c
index c617ec49e9ed..e6740656ee7c 100644
--- a/drivers/pinctrl/berlin/berlin-bg4ct.c
+++ b/drivers/pinctrl/berlin/berlin-bg4ct.c
@@ -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 <jszhang@marvell.com>");
-MODULE_DESCRIPTION("Marvell berlin4ct pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin4ct_pinctrl_driver);
-- 
2.11.0


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

* [PATCH 3/3] pinctrl: berlin: make bool drivers explicitly non-modular
@ 2017-02-06  8:03   ` Paul Gortmaker
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Gortmaker @ 2017-02-06  8:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Linus Walleij, Antoine Ténart,
	Sebastian Hesselbarth, Jisheng Zhang, Hongzhou Yang, Thomas Hebb,
	Masahiro Yamada, linux-gpio

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 <linus.walleij@linaro.org>
Cc: "Antoine Ténart" <antoine.tenart@free-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Jisheng Zhang <jszhang@marvell.com>
Cc: Hongzhou Yang <hongzhou.yang@mediatek.com>
Cc: Thomas Hebb <tommyhebb@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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(-)

diff --git a/drivers/pinctrl/berlin/berlin-bg2.c b/drivers/pinctrl/berlin/berlin-bg2.c
index fabe728ae268..bf2e17d0d6e4 100644
--- a/drivers/pinctrl/berlin/berlin-bg2.c
+++ b/drivers/pinctrl/berlin/berlin-bg2.c
@@ -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 <antoine.tenart@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Berlin BG2 pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2_pinctrl_driver);
diff --git a/drivers/pinctrl/berlin/berlin-bg2cd.c b/drivers/pinctrl/berlin/berlin-bg2cd.c
index ad8c75861373..9bee7bd1650f 100644
--- a/drivers/pinctrl/berlin/berlin-bg2cd.c
+++ b/drivers/pinctrl/berlin/berlin-bg2cd.c
@@ -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 <antoine.tenart@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Berlin BG2CD pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2cd_pinctrl_driver);
diff --git a/drivers/pinctrl/berlin/berlin-bg2q.c b/drivers/pinctrl/berlin/berlin-bg2q.c
index cd171aea8ca8..eee6763f114c 100644
--- a/drivers/pinctrl/berlin/berlin-bg2q.c
+++ b/drivers/pinctrl/berlin/berlin-bg2q.c
@@ -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 <antoine.tenart@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell Berlin BG2Q pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin2q_pinctrl_driver);
diff --git a/drivers/pinctrl/berlin/berlin-bg4ct.c b/drivers/pinctrl/berlin/berlin-bg4ct.c
index c617ec49e9ed..e6740656ee7c 100644
--- a/drivers/pinctrl/berlin/berlin-bg4ct.c
+++ b/drivers/pinctrl/berlin/berlin-bg4ct.c
@@ -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 <jszhang@marvell.com>");
-MODULE_DESCRIPTION("Marvell berlin4ct pinctrl driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver(berlin4ct_pinctrl_driver);
-- 
2.11.0

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

* Re: [PATCH 2/3] pinctrl: spear: make bool drivers explicitly non-modular
  2017-02-06  8:03   ` Paul Gortmaker
  (?)
@ 2017-02-07  4:12   ` Viresh Kumar
  -1 siblings, 0 replies; 13+ messages in thread
From: Viresh Kumar @ 2017-02-07  4:12 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Viresh Kumar, Linus Walleij, spear-devel, linux-gpio

On 06-02-17, 03:03, 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 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.
> 
> Cc: Viresh Kumar <vireshk@kernel.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: spear-devel@list.st.com
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  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(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH 3/3] pinctrl: berlin: make bool drivers explicitly non-modular
  2017-02-06  8:03   ` Paul Gortmaker
  (?)
@ 2017-02-07 11:19   ` Jisheng Zhang
  -1 siblings, 0 replies; 13+ messages in thread
From: Jisheng Zhang @ 2017-02-07 11:19 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Linus Walleij, Antoine Ténart,
	Sebastian Hesselbarth, Hongzhou Yang, Thomas Hebb,
	Masahiro Yamada, linux-gpio

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.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: "Antoine Ténart" <antoine.tenart@free-electrons.com>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: Jisheng Zhang <jszhang@marvell.com>
> Cc: Hongzhou Yang <hongzhou.yang@mediatek.com>
> Cc: Thomas Hebb <tommyhebb@gmail.com>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Jisheng Zhang <jszhang@marvell.com>

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

* Re: [PATCH 1/3] pinctrl: mvebu: make bool drivers explicitly non-modular
  2017-02-06  8:03   ` Paul Gortmaker
  (?)
@ 2017-02-13 13:22   ` Linus Walleij
  -1 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2017-02-13 13:22 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Thomas Petazzoni, linux-gpio

On Mon, Feb 6, 2017 at 9:03 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> 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 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.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 2/3] pinctrl: spear: make bool drivers explicitly non-modular
  2017-02-06  8:03   ` Paul Gortmaker
  (?)
  (?)
@ 2017-02-13 13:24   ` Linus Walleij
  -1 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2017-02-13 13:24 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Viresh Kumar, spear-devel, linux-gpio

On Mon, Feb 6, 2017 at 9:03 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> 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 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.
>
> Cc: Viresh Kumar <vireshk@kernel.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: spear-devel@list.st.com
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 3/3] pinctrl: berlin: make bool drivers explicitly non-modular
  2017-02-06  8:03   ` Paul Gortmaker
  (?)
  (?)
@ 2017-02-13 13:25   ` Linus Walleij
  -1 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2017-02-13 13:25 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Antoine Ténart, Sebastian Hesselbarth,
	Jisheng Zhang, Hongzhou Yang, Thomas Hebb, Masahiro Yamada,
	linux-gpio

On Mon, Feb 6, 2017 at 9:03 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> 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.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: "Antoine Ténart" <antoine.tenart@free-electrons.com>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: Jisheng Zhang <jszhang@marvell.com>
> Cc: Hongzhou Yang <hongzhou.yang@mediatek.com>
> Cc: Thomas Hebb <tommyhebb@gmail.com>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Patch applied.

Yours,
Linus Walleij

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

end of thread, other threads:[~2017-02-13 13:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06  8:03 [PATCH 0/3] pinctrl: berlin/mvebu/spear: make bool code non-modular Paul Gortmaker
2017-02-06  8:03 ` Paul Gortmaker
2017-02-06  8:03 ` [PATCH 1/3] pinctrl: mvebu: make bool drivers explicitly non-modular Paul Gortmaker
2017-02-06  8:03   ` Paul Gortmaker
2017-02-13 13:22   ` Linus Walleij
2017-02-06  8:03 ` [PATCH 2/3] pinctrl: spear: " Paul Gortmaker
2017-02-06  8:03   ` Paul Gortmaker
2017-02-07  4:12   ` Viresh Kumar
2017-02-13 13:24   ` Linus Walleij
2017-02-06  8:03 ` [PATCH 3/3] pinctrl: berlin: " Paul Gortmaker
2017-02-06  8:03   ` Paul Gortmaker
2017-02-07 11:19   ` Jisheng Zhang
2017-02-13 13:25   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.