linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] pinctrl: make non-modular drivers really non modular
@ 2016-06-07  2:42 Paul Gortmaker
  2016-06-07  2:43 ` [PATCH 1/9] pinctrl: as3722: make it explicitly non-modular Paul Gortmaker
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Baruch Siach, Heikki Krogerus,
	Jean-Christophe Plagniol-Villard, Jeff Wu, Joachim Eastwood,
	Ken Xue, Laxman Dewangan, Linus Walleij, Ludovic Desroches,
	Michal Simek, Mika Westerberg, Sören Brinkmann, linux-gpio

For anyone new to the underlying goal of this cleanup, we are trying to
not use module support for code that can never be built as a module since:

 (1) it is easy to accidentally write unused module_exit and remove code
 (2) it can be misleading when reading the source, thinking it can be
     modular when the Makefile and/or Kconfig prohibit it
 (3) it requires the include of the module.h header file which in turn
     includes nearly everything else, thus adding to CPP overhead.
 (4) it gets copied/replicated into other code and spreads like weeds.

Similar to what was done for GPIO, I'd divided up the the audit of
modular usage in non-modular pinctrl drivers into reasonable batch
sizes to hopefully ease review.

This batch deals with individual standalone drivers that are nearly
all in the top level directory.

Changes seen here cover the following categories:

  -just replacement of modular macros with their non-modular
   equivalents that CPP would have inserted anyway

  -the removal of including module.h ; replaced with init.h
   as required based on whether the file already had it.

  -the removal of any/all unused/orphaned __exit functions
   that would never be called/exercised.

  -the removal of any ".remove" functions that were hooked into
   the driver struct.   This ".remove" function would of
   course not be called from the __exit function since that was
   never run.  However in theory, someone could have triggered it
   via sysfs unbind, even though there isn't a sensible use case
   for doing so.  So to cover that possibility, we've also disabled
   sysfs unbind in these drivers.

There are no initcall level changes here; everything was at the level
of device_initcall and remains so, by using the builtin equivalents.

Build tested for several different key arch on the Monday linux-next
tree to ensure no silly typos crept in.

Paul.
---

Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Jeff Wu <Jeff.Wu@amd.com>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: Ken Xue <Ken.Xue@amd.com>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: linux-gpio@vger.kernel.org

Paul Gortmaker (9):
  pinctrl: as3722: make it explicitly non-modular
  pinctrl: baytrail: make it explicitly non-modular
  pinctrl: at91: make it explicitly non-modular
  pinctrl: lpc18xx: make it explicitly non-modular
  pinctrl: amd: make it explicitly non-modular
  pinctrl: palmas: make it explicitly non-modular
  pinctrl: zynq: make it explicitly non-modular
  pinctrl: digicolor: make it explicitly non-modular
  pinctrl: at91-pio4: make it explicitly non-modular

 drivers/pinctrl/intel/pinctrl-baytrail.c | 25 ++++---------------------
 drivers/pinctrl/pinctrl-amd.c            | 23 +++--------------------
 drivers/pinctrl/pinctrl-as3722.c         | 20 +++-----------------
 drivers/pinctrl/pinctrl-at91-pio4.c      | 22 +++-------------------
 drivers/pinctrl/pinctrl-at91.c           | 11 -----------
 drivers/pinctrl/pinctrl-digicolor.c      | 16 +++-------------
 drivers/pinctrl/pinctrl-lpc18xx.c        | 20 +++-----------------
 drivers/pinctrl/pinctrl-palmas.c         | 10 ++--------
 drivers/pinctrl/pinctrl-zynq.c           | 13 +------------
 9 files changed, 22 insertions(+), 138 deletions(-)

-- 
2.8.0

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

* [PATCH 1/9] pinctrl: as3722: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-07  6:36   ` Laxman Dewangan
  2016-06-07  2:43 ` [PATCH 2/9] pinctrl: baytrail: " Paul Gortmaker
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Laxman Dewangan, Linus Walleij, linux-gpio

The Kconfig currently controlling compilation of this code is:

config PINCTRL_AS3722
        bool "Pinctrl and GPIO driver for ams AS3722 PMIC"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_ALIAS and MODULE_DEVICE_TABLE are a no-op for
non-modular code and hence both are removed.

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: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/pinctrl-as3722.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c
index 4e9fe7854e8a..fb4f5372ab04 100644
--- a/drivers/pinctrl/pinctrl-as3722.c
+++ b/drivers/pinctrl/pinctrl-as3722.c
@@ -23,7 +23,7 @@
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mfd/as3722.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -599,31 +599,17 @@ fail_range_add:
 	return ret;
 }
 
-static int as3722_pinctrl_remove(struct platform_device *pdev)
-{
-	struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev);
-
-	gpiochip_remove(&as_pci->gpio_chip);
-	return 0;
-}
-
 static const struct of_device_id as3722_pinctrl_of_match[] = {
 	{ .compatible = "ams,as3722-pinctrl", },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, as3722_pinctrl_of_match);
 
 static struct platform_driver as3722_pinctrl_driver = {
 	.driver = {
 		.name = "as3722-pinctrl",
+		.suppress_bind_attrs = true,
 		.of_match_table = as3722_pinctrl_of_match,
 	},
 	.probe = as3722_pinctrl_probe,
-	.remove = as3722_pinctrl_remove,
 };
-module_platform_driver(as3722_pinctrl_driver);
-
-MODULE_ALIAS("platform:as3722-pinctrl");
-MODULE_DESCRIPTION("AS3722 pin control and GPIO driver");
-MODULE_AUTHOR("Laxman Dewangan<ldewangan@nvidia.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(as3722_pinctrl_driver);
-- 
2.8.0

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

* [PATCH 2/9] pinctrl: baytrail: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
  2016-06-07  2:43 ` [PATCH 1/9] pinctrl: as3722: make it explicitly non-modular Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-09 14:10   ` Mika Westerberg
  2016-06-13  6:26   ` Linus Walleij
  2016-06-07  2:43 ` [PATCH 3/9] pinctrl: at91: " Paul Gortmaker
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Mika Westerberg, Heikki Krogerus, Linus Walleij,
	linux-gpio

The Kconfig currently controlling compilation of this code is:

config PINCTRL_BAYTRAIL
        bool "Intel Baytrail GPIO pin control"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init() was already not in use in this driver, we don't
have any concerns with init ordering changes here.

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: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/intel/pinctrl-baytrail.c | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index 677a811b3a6f..b2df03e9e431 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -15,7 +15,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/bitops.h>
@@ -1822,17 +1821,6 @@ static int byt_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int byt_pinctrl_remove(struct platform_device *pdev)
-{
-	struct byt_gpio *vg = platform_get_drvdata(pdev);
-
-	pm_runtime_disable(&pdev->dev);
-	gpiochip_remove(&vg->chip);
-	pinctrl_unregister(vg->pctl_dev);
-
-	return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int byt_gpio_suspend(struct device *dev)
 {
@@ -1930,10 +1918,11 @@ static const struct dev_pm_ops byt_gpio_pm_ops = {
 
 static struct platform_driver byt_gpio_driver = {
 	.probe          = byt_pinctrl_probe,
-	.remove         = byt_pinctrl_remove,
 	.driver         = {
-		.name   = "byt_gpio",
-		.pm	= &byt_gpio_pm_ops,
+		.name			= "byt_gpio",
+		.pm			= &byt_gpio_pm_ops,
+		.suppress_bind_attrs	= true,
+
 		.acpi_match_table = ACPI_PTR(byt_gpio_acpi_match),
 	},
 };
@@ -1943,9 +1932,3 @@ static int __init byt_gpio_init(void)
 	return platform_driver_register(&byt_gpio_driver);
 }
 subsys_initcall(byt_gpio_init);
-
-static void __exit byt_gpio_exit(void)
-{
-	platform_driver_unregister(&byt_gpio_driver);
-}
-module_exit(byt_gpio_exit);
-- 
2.8.0

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

* [PATCH 3/9] pinctrl: at91: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
  2016-06-07  2:43 ` [PATCH 1/9] pinctrl: as3722: make it explicitly non-modular Paul Gortmaker
  2016-06-07  2:43 ` [PATCH 2/9] pinctrl: baytrail: " Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-13  6:27   ` Linus Walleij
  2016-06-07  2:43 ` [PATCH 4/9] pinctrl: lpc18xx: " Paul Gortmaker
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Jean-Christophe Plagniol-Villard, Linus Walleij,
	linux-gpio

The Kconfig currently controlling compilation of this code is:

drivers/pinctrl/Kconfig:config PINCTRL_AT91
drivers/pinctrl/Kconfig:        bool "AT91 pinctrl driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not being used in this driver, we don't need
to be concerned with initcall ordering changes when removing it.

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: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/pinctrl-at91.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index b7c0d6f7c046..cb9a0849b8ba 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -9,7 +9,6 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/init.h>
-#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_address.h>
@@ -1818,13 +1817,3 @@ static int __init at91_pinctrl_init(void)
 	return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
 }
 arch_initcall(at91_pinctrl_init);
-
-static void __exit at91_pinctrl_exit(void)
-{
-	platform_unregister_drivers(drivers, ARRAY_SIZE(drivers));
-}
-
-module_exit(at91_pinctrl_exit);
-MODULE_AUTHOR("Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>");
-MODULE_DESCRIPTION("Atmel AT91 pinctrl driver");
-MODULE_LICENSE("GPL v2");
-- 
2.8.0

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

* [PATCH 4/9] pinctrl: lpc18xx: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
                   ` (2 preceding siblings ...)
  2016-06-07  2:43 ` [PATCH 3/9] pinctrl: at91: " Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-13  6:28   ` Linus Walleij
  2016-06-07  2:43 ` [PATCH 5/9] pinctrl: amd: " Paul Gortmaker
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Linus Walleij, Joachim Eastwood, linux-gpio

The Kconfig currently controlling compilation of this code is:

config PINCTRL_LPC18XX
        bool "NXP LPC18XX/43XX SCU pinctrl driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

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

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

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/pinctrl-lpc18xx.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-lpc18xx.c b/drivers/pinctrl/pinctrl-lpc18xx.c
index 8a931c7ba2ff..e053f1fa5512 100644
--- a/drivers/pinctrl/pinctrl-lpc18xx.c
+++ b/drivers/pinctrl/pinctrl-lpc18xx.c
@@ -11,7 +11,7 @@
 #include <linux/bitops.h>
 #include <linux/clk.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/pinctrl/pinctrl.h>
@@ -1365,31 +1365,17 @@ static int lpc18xx_scu_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int lpc18xx_scu_remove(struct platform_device *pdev)
-{
-	struct lpc18xx_scu_data *scu = platform_get_drvdata(pdev);
-
-	clk_disable_unprepare(scu->clk);
-
-	return 0;
-}
-
 static const struct of_device_id lpc18xx_scu_match[] = {
 	{ .compatible = "nxp,lpc1850-scu" },
 	{},
 };
-MODULE_DEVICE_TABLE(of, lpc18xx_scu_match);
 
 static struct platform_driver lpc18xx_scu_driver = {
 	.probe		= lpc18xx_scu_probe,
-	.remove		= lpc18xx_scu_remove,
 	.driver = {
 		.name		= "lpc18xx-scu",
 		.of_match_table	= lpc18xx_scu_match,
+		.suppress_bind_attrs = true,
 	},
 };
-module_platform_driver(lpc18xx_scu_driver);
-
-MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
-MODULE_DESCRIPTION("Pinctrl driver for NXP LPC18xx/43xx SCU");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(lpc18xx_scu_driver);
-- 
2.8.0

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

* [PATCH 5/9] pinctrl: amd: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
                   ` (3 preceding siblings ...)
  2016-06-07  2:43 ` [PATCH 4/9] pinctrl: lpc18xx: " Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-13  6:29   ` Linus Walleij
  2016-06-07  2:43 ` [PATCH 6/9] pinctrl: palmas: " Paul Gortmaker
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Linus Walleij, linux-gpio, Ken Xue, Jeff Wu

The Kconfig currently controlling compilation of this code is:

config PINCTRL_AMD
        bool "AMD GPIO pin control"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

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

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

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Cc: Ken Xue <Ken.Xue@amd.com>
Cc: Jeff Wu <Jeff.Wu@amd.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/pinctrl-amd.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 634b4d30eefb..b466d70b9004 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -13,7 +13,7 @@
 #include <linux/err.h>
 #include <linux/bug.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/compiler.h>
 #include <linux/types.h>
@@ -828,35 +828,18 @@ out2:
 	return ret;
 }
 
-static int amd_gpio_remove(struct platform_device *pdev)
-{
-	struct amd_gpio *gpio_dev;
-
-	gpio_dev = platform_get_drvdata(pdev);
-
-	gpiochip_remove(&gpio_dev->gc);
-
-	return 0;
-}
-
 static const struct acpi_device_id amd_gpio_acpi_match[] = {
 	{ "AMD0030", 0 },
 	{ "AMDI0030", 0},
 	{ },
 };
-MODULE_DEVICE_TABLE(acpi, amd_gpio_acpi_match);
 
 static struct platform_driver amd_gpio_driver = {
 	.driver		= {
 		.name	= "amd_gpio",
+		.suppress_bind_attrs = true,
 		.acpi_match_table = ACPI_PTR(amd_gpio_acpi_match),
 	},
 	.probe		= amd_gpio_probe,
-	.remove		= amd_gpio_remove,
 };
-
-module_platform_driver(amd_gpio_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Ken Xue <Ken.Xue@amd.com>, Jeff Wu <Jeff.Wu@amd.com>");
-MODULE_DESCRIPTION("AMD GPIO pinctrl driver");
+builtin_platform_driver(amd_gpio_driver);
-- 
2.8.0

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

* [PATCH 6/9] pinctrl: palmas: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
                   ` (4 preceding siblings ...)
  2016-06-07  2:43 ` [PATCH 5/9] pinctrl: amd: " Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-07  6:36   ` Laxman Dewangan
  2016-06-07  2:43 ` [PATCH 7/9] pinctrl: zynq: " Paul Gortmaker
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Laxman Dewangan, Linus Walleij, linux-gpio

The Kconfig currently controlling compilation of this code is:

config PINCTRL_PALMAS
        bool "Pinctrl driver for the PALMAS Series MFD devices"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

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: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/pinctrl-palmas.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-palmas.c b/drivers/pinctrl/pinctrl-palmas.c
index 8edb3f8c72c8..3def8805a882 100644
--- a/drivers/pinctrl/pinctrl-palmas.c
+++ b/drivers/pinctrl/pinctrl-palmas.c
@@ -21,7 +21,7 @@
  */
 
 #include <linux/delay.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mfd/palmas.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -1059,10 +1059,4 @@ static struct platform_driver palmas_pinctrl_driver = {
 	},
 	.probe = palmas_pinctrl_probe,
 };
-
-module_platform_driver(palmas_pinctrl_driver);
-
-MODULE_DESCRIPTION("Palmas pin control driver");
-MODULE_AUTHOR("Laxman Dewangan<ldewangan@nvidia.com>");
-MODULE_ALIAS("platform:palmas-pinctrl");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(palmas_pinctrl_driver);
-- 
2.8.0

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

* [PATCH 7/9] pinctrl: zynq: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
                   ` (5 preceding siblings ...)
  2016-06-07  2:43 ` [PATCH 6/9] pinctrl: palmas: " Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-07  2:54   ` Sören Brinkmann
  2016-06-07  7:15   ` Michal Simek
  2016-06-07  2:43 ` [PATCH 8/9] pinctrl: digicolor: " Paul Gortmaker
  2016-06-07  2:43 ` [PATCH 9/9] pinctrl: at91-pio4: " Paul Gortmaker
  8 siblings, 2 replies; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Linus Walleij, Michal Simek,
	Sören Brinkmann, linux-gpio

The Kconfig currently controlling compilation of this code is:

config PINCTRL_ZYNQ
        bool "Pinctrl driver for Xilinx Zynq"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

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

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

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/pinctrl-zynq.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
index 8fdc60c5aeaf..7afdbede6823 100644
--- a/drivers/pinctrl/pinctrl-zynq.c
+++ b/drivers/pinctrl/pinctrl-zynq.c
@@ -20,7 +20,7 @@
  */
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pinctrl/pinctrl.h>
@@ -1210,7 +1210,6 @@ static const struct of_device_id zynq_pinctrl_of_match[] = {
 	{ .compatible = "xlnx,pinctrl-zynq" },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, zynq_pinctrl_of_match);
 
 static struct platform_driver zynq_pinctrl_driver = {
 	.driver = {
@@ -1225,13 +1224,3 @@ static int __init zynq_pinctrl_init(void)
 	return platform_driver_register(&zynq_pinctrl_driver);
 }
 arch_initcall(zynq_pinctrl_init);
-
-static void __exit zynq_pinctrl_exit(void)
-{
-	platform_driver_unregister(&zynq_pinctrl_driver);
-}
-module_exit(zynq_pinctrl_exit);
-
-MODULE_AUTHOR("Sören Brinkmann <soren.brinkmann@xilinx.com>");
-MODULE_DESCRIPTION("Xilinx Zynq pinctrl driver");
-MODULE_LICENSE("GPL");
-- 
2.8.0

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

* [PATCH 8/9] pinctrl: digicolor: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
                   ` (6 preceding siblings ...)
  2016-06-07  2:43 ` [PATCH 7/9] pinctrl: zynq: " Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-07  6:13   ` Baruch Siach
  2016-06-13  6:33   ` Linus Walleij
  2016-06-07  2:43 ` [PATCH 9/9] pinctrl: at91-pio4: " Paul Gortmaker
  8 siblings, 2 replies; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Linus Walleij, Baruch Siach, linux-gpio

The Kconfig currently controlling compilation of this code is:

drivers/pinctrl/Kconfig:config PINCTRL_DIGICOLOR
drivers/pinctrl/Kconfig:        bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

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

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/pinctrl-digicolor.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
index c8073d442dcb..aba3da5ee844 100644
--- a/drivers/pinctrl/pinctrl-digicolor.c
+++ b/drivers/pinctrl/pinctrl-digicolor.c
@@ -15,7 +15,7 @@
  * - Pin pad configuration (pull up/down, strength)
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -337,27 +337,17 @@ static int dc_pinctrl_probe(struct platform_device *pdev)
 	return dc_gpiochip_add(pmap, pdev->dev.of_node);
 }
 
-static int dc_pinctrl_remove(struct platform_device *pdev)
-{
-	struct dc_pinmap *pmap = platform_get_drvdata(pdev);
-
-	gpiochip_remove(&pmap->chip);
-
-	return 0;
-}
-
 static const struct of_device_id dc_pinctrl_ids[] = {
 	{ .compatible = "cnxt,cx92755-pinctrl" },
 	{ /* sentinel */ }
 };
-MODULE_DEVICE_TABLE(of, dc_pinctrl_ids);
 
 static struct platform_driver dc_pinctrl_driver = {
 	.driver = {
 		.name = DRIVER_NAME,
 		.of_match_table = dc_pinctrl_ids,
+		.suppress_bind_attrs = true,
 	},
 	.probe = dc_pinctrl_probe,
-	.remove = dc_pinctrl_remove,
 };
-module_platform_driver(dc_pinctrl_driver);
+builtin_platform_driver(dc_pinctrl_driver);
-- 
2.8.0

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

* [PATCH 9/9] pinctrl: at91-pio4: make it explicitly non-modular
  2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
                   ` (7 preceding siblings ...)
  2016-06-07  2:43 ` [PATCH 8/9] pinctrl: digicolor: " Paul Gortmaker
@ 2016-06-07  2:43 ` Paul Gortmaker
  2016-06-08  6:27   ` Ludovic Desroches
  2016-06-13  6:39   ` Linus Walleij
  8 siblings, 2 replies; 24+ messages in thread
From: Paul Gortmaker @ 2016-06-07  2:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Ludovic Desroches, Linus Walleij, linux-gpio

The Kconfig currently controlling compilation of this code is:

drivers/pinctrl/Kconfig:config PINCTRL_AT91PIO4
drivers/pinctrl/Kconfig:        bool "AT91 PIO4 pinctrl driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

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

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

Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pinctrl/pinctrl-at91-pio4.c | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index a025b40d246b..4438dca85c1c 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -20,7 +20,7 @@
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pinctrl/pinconf.h>
@@ -879,7 +879,6 @@ static const struct of_device_id atmel_pctrl_of_match[] = {
 		/* sentinel */
 	}
 };
-MODULE_DEVICE_TABLE(of, atmel_pctrl_of_match);
 
 static int atmel_pinctrl_probe(struct platform_device *pdev)
 {
@@ -1074,28 +1073,13 @@ clk_prepare_enable_error:
 	return ret;
 }
 
-int atmel_pinctrl_remove(struct platform_device *pdev)
-{
-	struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev);
-
-	irq_domain_remove(atmel_pioctrl->irq_domain);
-	clk_disable_unprepare(atmel_pioctrl->clk);
-	gpiochip_remove(atmel_pioctrl->gpio_chip);
-
-	return 0;
-}
-
 static struct platform_driver atmel_pinctrl_driver = {
 	.driver = {
 		.name = "pinctrl-at91-pio4",
 		.of_match_table = atmel_pctrl_of_match,
 		.pm = &atmel_pctrl_pm_ops,
+		.suppress_bind_attrs = true,
 	},
 	.probe = atmel_pinctrl_probe,
-	.remove = atmel_pinctrl_remove,
 };
-module_platform_driver(atmel_pinctrl_driver);
-
-MODULE_AUTHOR(Ludovic Desroches <ludovic.desroches@atmel.com>);
-MODULE_DESCRIPTION("Atmel PIO4 pinctrl driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(atmel_pinctrl_driver);
-- 
2.8.0

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

* Re: [PATCH 7/9] pinctrl: zynq: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 7/9] pinctrl: zynq: " Paul Gortmaker
@ 2016-06-07  2:54   ` Sören Brinkmann
  2016-06-07  7:15   ` Michal Simek
  1 sibling, 0 replies; 24+ messages in thread
From: Sören Brinkmann @ 2016-06-07  2:54 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Linus Walleij, Michal Simek, linux-gpio

On Mon, 2016-06-06 at 22:43:06 -0400, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> config PINCTRL_ZYNQ
>         bool "Pinctrl driver for Xilinx Zynq"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: "Sören Brinkmann" <soren.brinkmann@xilinx.com>

	Sören

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

* Re: [PATCH 8/9] pinctrl: digicolor: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 8/9] pinctrl: digicolor: " Paul Gortmaker
@ 2016-06-07  6:13   ` Baruch Siach
  2016-06-13  6:34     ` Linus Walleij
  2016-06-13  6:33   ` Linus Walleij
  1 sibling, 1 reply; 24+ messages in thread
From: Baruch Siach @ 2016-06-07  6:13 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Linus Walleij, linux-gpio, Masahiro Yamada

Hi Paul,

On Mon, Jun 06, 2016 at 10:43:07PM -0400, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pinctrl/Kconfig:config PINCTRL_DIGICOLOR
> drivers/pinctrl/Kconfig:        bool
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Baruch Siach <baruch@tkos.co.il>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Thanks. In addition to that you can also revert 8b2b3dcb343b (pinctrl: 
digicolor: add missing platform_set_drvdata() call) that is currently in the 
linux-pinctrl tree. Other then that:

Acked-by: Baruch Siach <baruch@tkos.co.il>

baruch

> ---
>  drivers/pinctrl/pinctrl-digicolor.c | 16 +++-------------
>  1 file changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
> index c8073d442dcb..aba3da5ee844 100644
> --- a/drivers/pinctrl/pinctrl-digicolor.c
> +++ b/drivers/pinctrl/pinctrl-digicolor.c
> @@ -15,7 +15,7 @@
>   * - Pin pad configuration (pull up/down, strength)
>   */
>  
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/platform_device.h>
>  #include <linux/of.h>
>  #include <linux/of_device.h>
> @@ -337,27 +337,17 @@ static int dc_pinctrl_probe(struct platform_device *pdev)
>  	return dc_gpiochip_add(pmap, pdev->dev.of_node);
>  }
>  
> -static int dc_pinctrl_remove(struct platform_device *pdev)
> -{
> -	struct dc_pinmap *pmap = platform_get_drvdata(pdev);
> -
> -	gpiochip_remove(&pmap->chip);
> -
> -	return 0;
> -}
> -
>  static const struct of_device_id dc_pinctrl_ids[] = {
>  	{ .compatible = "cnxt,cx92755-pinctrl" },
>  	{ /* sentinel */ }
>  };
> -MODULE_DEVICE_TABLE(of, dc_pinctrl_ids);
>  
>  static struct platform_driver dc_pinctrl_driver = {
>  	.driver = {
>  		.name = DRIVER_NAME,
>  		.of_match_table = dc_pinctrl_ids,
> +		.suppress_bind_attrs = true,
>  	},
>  	.probe = dc_pinctrl_probe,
> -	.remove = dc_pinctrl_remove,
>  };
> -module_platform_driver(dc_pinctrl_driver);
> +builtin_platform_driver(dc_pinctrl_driver);
> -- 
> 2.8.0
> 

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* Re: [PATCH 1/9] pinctrl: as3722: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 1/9] pinctrl: as3722: make it explicitly non-modular Paul Gortmaker
@ 2016-06-07  6:36   ` Laxman Dewangan
  0 siblings, 0 replies; 24+ messages in thread
From: Laxman Dewangan @ 2016-06-07  6:36 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel; +Cc: Linus Walleij, linux-gpio


On Tuesday 07 June 2016 08:13 AM, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
>
> config PINCTRL_AS3722
>          bool "Pinctrl and GPIO driver for ams AS3722 PMIC"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_ALIAS and MODULE_DEVICE_TABLE are a no-op for
> non-modular code and hence both are removed.
>
> 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: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>


I will say lets make the driver as tristate.

tristate "Pinctrl and GPIO driver for ams AS3722 PMIC"

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

* Re: [PATCH 6/9] pinctrl: palmas: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 6/9] pinctrl: palmas: " Paul Gortmaker
@ 2016-06-07  6:36   ` Laxman Dewangan
  0 siblings, 0 replies; 24+ messages in thread
From: Laxman Dewangan @ 2016-06-07  6:36 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel; +Cc: Linus Walleij, linux-gpio


On Tuesday 07 June 2016 08:13 AM, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
>
> config PINCTRL_PALMAS
>          bool "Pinctrl driver for the PALMAS Series MFD devices"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> 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: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


Let's make the driver as tristate.

tristate "Pinctrl driver for the PALMAS Series MFD devices"

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

* Re: [PATCH 7/9] pinctrl: zynq: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 7/9] pinctrl: zynq: " Paul Gortmaker
  2016-06-07  2:54   ` Sören Brinkmann
@ 2016-06-07  7:15   ` Michal Simek
  1 sibling, 0 replies; 24+ messages in thread
From: Michal Simek @ 2016-06-07  7:15 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Linus Walleij, Michal Simek, Sören Brinkmann, linux-gpio

On 7.6.2016 04:43, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> config PINCTRL_ZYNQ
>         bool "Pinctrl driver for Xilinx Zynq"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pinctrl/pinctrl-zynq.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
> index 8fdc60c5aeaf..7afdbede6823 100644
> --- a/drivers/pinctrl/pinctrl-zynq.c
> +++ b/drivers/pinctrl/pinctrl-zynq.c
> @@ -20,7 +20,7 @@
>   */
>  #include <linux/io.h>
>  #include <linux/mfd/syscon.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pinctrl/pinctrl.h>
> @@ -1210,7 +1210,6 @@ static const struct of_device_id zynq_pinctrl_of_match[] = {
>  	{ .compatible = "xlnx,pinctrl-zynq" },
>  	{ }
>  };
> -MODULE_DEVICE_TABLE(of, zynq_pinctrl_of_match);
>  
>  static struct platform_driver zynq_pinctrl_driver = {
>  	.driver = {
> @@ -1225,13 +1224,3 @@ static int __init zynq_pinctrl_init(void)
>  	return platform_driver_register(&zynq_pinctrl_driver);
>  }
>  arch_initcall(zynq_pinctrl_init);
> -
> -static void __exit zynq_pinctrl_exit(void)
> -{
> -	platform_driver_unregister(&zynq_pinctrl_driver);
> -}
> -module_exit(zynq_pinctrl_exit);
> -
> -MODULE_AUTHOR("Sören Brinkmann <soren.brinkmann@xilinx.com>");
> -MODULE_DESCRIPTION("Xilinx Zynq pinctrl driver");
> -MODULE_LICENSE("GPL");
> 

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

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

* Re: [PATCH 9/9] pinctrl: at91-pio4: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 9/9] pinctrl: at91-pio4: " Paul Gortmaker
@ 2016-06-08  6:27   ` Ludovic Desroches
  2016-06-13  6:39   ` Linus Walleij
  1 sibling, 0 replies; 24+ messages in thread
From: Ludovic Desroches @ 2016-06-08  6:27 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Ludovic Desroches, Linus Walleij, linux-gpio

On Mon, Jun 06, 2016 at 10:43:08PM -0400, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pinctrl/Kconfig:config PINCTRL_AT91PIO4
> drivers/pinctrl/Kconfig:        bool "AT91 PIO4 pinctrl driver"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
> 
> Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Thanks for cleaning this stuff.
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>

> ---
>  drivers/pinctrl/pinctrl-at91-pio4.c | 22 +++-------------------
>  1 file changed, 3 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
> index a025b40d246b..4438dca85c1c 100644
> --- a/drivers/pinctrl/pinctrl-at91-pio4.c
> +++ b/drivers/pinctrl/pinctrl-at91-pio4.c
> @@ -20,7 +20,7 @@
>  #include <linux/gpio.h>
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pinctrl/pinconf.h>
> @@ -879,7 +879,6 @@ static const struct of_device_id atmel_pctrl_of_match[] = {
>  		/* sentinel */
>  	}
>  };
> -MODULE_DEVICE_TABLE(of, atmel_pctrl_of_match);
>  
>  static int atmel_pinctrl_probe(struct platform_device *pdev)
>  {
> @@ -1074,28 +1073,13 @@ clk_prepare_enable_error:
>  	return ret;
>  }
>  
> -int atmel_pinctrl_remove(struct platform_device *pdev)
> -{
> -	struct atmel_pioctrl *atmel_pioctrl = platform_get_drvdata(pdev);
> -
> -	irq_domain_remove(atmel_pioctrl->irq_domain);
> -	clk_disable_unprepare(atmel_pioctrl->clk);
> -	gpiochip_remove(atmel_pioctrl->gpio_chip);
> -
> -	return 0;
> -}
> -
>  static struct platform_driver atmel_pinctrl_driver = {
>  	.driver = {
>  		.name = "pinctrl-at91-pio4",
>  		.of_match_table = atmel_pctrl_of_match,
>  		.pm = &atmel_pctrl_pm_ops,
> +		.suppress_bind_attrs = true,
>  	},
>  	.probe = atmel_pinctrl_probe,
> -	.remove = atmel_pinctrl_remove,
>  };
> -module_platform_driver(atmel_pinctrl_driver);
> -
> -MODULE_AUTHOR(Ludovic Desroches <ludovic.desroches@atmel.com>);
> -MODULE_DESCRIPTION("Atmel PIO4 pinctrl driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(atmel_pinctrl_driver);
> -- 
> 2.8.0
> 

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

* Re: [PATCH 2/9] pinctrl: baytrail: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 2/9] pinctrl: baytrail: " Paul Gortmaker
@ 2016-06-09 14:10   ` Mika Westerberg
  2016-06-13  6:26   ` Linus Walleij
  1 sibling, 0 replies; 24+ messages in thread
From: Mika Westerberg @ 2016-06-09 14:10 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Heikki Krogerus, Linus Walleij, linux-gpio

On Mon, Jun 06, 2016 at 10:43:01PM -0400, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> config PINCTRL_BAYTRAIL
>         bool "Intel Baytrail GPIO pin control"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
> 
> Since module_init() was already not in use in this driver, we don't
> have any concerns with init ordering changes here.
> 
> 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: Mika Westerberg <mika.westerberg@linux.intel.com>

Yeah, probably good thing to do. No objections from me.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH 2/9] pinctrl: baytrail: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 2/9] pinctrl: baytrail: " Paul Gortmaker
  2016-06-09 14:10   ` Mika Westerberg
@ 2016-06-13  6:26   ` Linus Walleij
  1 sibling, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2016-06-13  6:26 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Mika Westerberg, Heikki Krogerus, linux-gpio

On Tue, Jun 7, 2016 at 4:43 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> config PINCTRL_BAYTRAIL
>         bool "Intel Baytrail GPIO pin control"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
>
> Since module_init() was already not in use in this driver, we don't
> have any concerns with init ordering changes here.
>
> 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: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Patch applied with Mika's ACK.

Yours,
Linus Walleij

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

* Re: [PATCH 3/9] pinctrl: at91: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 3/9] pinctrl: at91: " Paul Gortmaker
@ 2016-06-13  6:27   ` Linus Walleij
  0 siblings, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2016-06-13  6:27 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Jean-Christophe Plagniol-Villard, linux-gpio

On Tue, Jun 7, 2016 at 4:43 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/pinctrl/Kconfig:config PINCTRL_AT91
> drivers/pinctrl/Kconfig:        bool "AT91 pinctrl driver"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> Since module_init was not being used in this driver, we don't need
> to be concerned with initcall ordering changes when removing it.
>
> 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: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> 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] 24+ messages in thread

* Re: [PATCH 4/9] pinctrl: lpc18xx: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 4/9] pinctrl: lpc18xx: " Paul Gortmaker
@ 2016-06-13  6:28   ` Linus Walleij
  0 siblings, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2016-06-13  6:28 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Joachim Eastwood, linux-gpio

On Tue, Jun 7, 2016 at 4:43 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> config PINCTRL_LPC18XX
>         bool "NXP LPC18XX/43XX SCU pinctrl driver"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Joachim Eastwood <manabian@gmail.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] 24+ messages in thread

* Re: [PATCH 5/9] pinctrl: amd: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 5/9] pinctrl: amd: " Paul Gortmaker
@ 2016-06-13  6:29   ` Linus Walleij
  0 siblings, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2016-06-13  6:29 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, linux-gpio, Ken Xue, Jeff Wu

On Tue, Jun 7, 2016 at 4:43 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> config PINCTRL_AMD
>         bool "AMD GPIO pin control"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-gpio@vger.kernel.org
> Cc: Ken Xue <Ken.Xue@amd.com>
> Cc: Jeff Wu <Jeff.Wu@amd.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 8/9] pinctrl: digicolor: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 8/9] pinctrl: digicolor: " Paul Gortmaker
  2016-06-07  6:13   ` Baruch Siach
@ 2016-06-13  6:33   ` Linus Walleij
  1 sibling, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2016-06-13  6:33 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Baruch Siach, linux-gpio

On Tue, Jun 7, 2016 at 4:43 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/pinctrl/Kconfig:config PINCTRL_DIGICOLOR
> drivers/pinctrl/Kconfig:        bool
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Baruch Siach <baruch@tkos.co.il>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Patch applied with Baruch's ACK.

Yours,
Linus Walleij

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

* Re: [PATCH 8/9] pinctrl: digicolor: make it explicitly non-modular
  2016-06-07  6:13   ` Baruch Siach
@ 2016-06-13  6:34     ` Linus Walleij
  0 siblings, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2016-06-13  6:34 UTC (permalink / raw)
  To: Baruch Siach; +Cc: Paul Gortmaker, linux-kernel, linux-gpio, Masahiro Yamada

On Tue, Jun 7, 2016 at 8:13 AM, Baruch Siach <baruch@tkos.co.il> wrote:

> Thanks. In addition to that you can also revert 8b2b3dcb343b (pinctrl:
> digicolor: add missing platform_set_drvdata() call) that is currently in the
> linux-pinctrl tree.

That must be discussed in the context of the offending patch,
not in this mail trail.

Yours,
Linus Walleij

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

* Re: [PATCH 9/9] pinctrl: at91-pio4: make it explicitly non-modular
  2016-06-07  2:43 ` [PATCH 9/9] pinctrl: at91-pio4: " Paul Gortmaker
  2016-06-08  6:27   ` Ludovic Desroches
@ 2016-06-13  6:39   ` Linus Walleij
  1 sibling, 0 replies; 24+ messages in thread
From: Linus Walleij @ 2016-06-13  6:39 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Ludovic Desroches, linux-gpio

On Tue, Jun 7, 2016 at 4:43 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:

> The Kconfig currently controlling compilation of this code is:
>
> drivers/pinctrl/Kconfig:config PINCTRL_AT91PIO4
> drivers/pinctrl/Kconfig:        bool "AT91 PIO4 pinctrl driver"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>
> We also delete the MODULE_LICENSE tag etc. since all that information
> is already contained at the top of the file in the comments.
>
> Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Patch applied with Ludovic's ACK.

Yours,
Linus Walleij

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

end of thread, other threads:[~2016-06-13  6:39 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07  2:42 [PATCH 0/9] pinctrl: make non-modular drivers really non modular Paul Gortmaker
2016-06-07  2:43 ` [PATCH 1/9] pinctrl: as3722: make it explicitly non-modular Paul Gortmaker
2016-06-07  6:36   ` Laxman Dewangan
2016-06-07  2:43 ` [PATCH 2/9] pinctrl: baytrail: " Paul Gortmaker
2016-06-09 14:10   ` Mika Westerberg
2016-06-13  6:26   ` Linus Walleij
2016-06-07  2:43 ` [PATCH 3/9] pinctrl: at91: " Paul Gortmaker
2016-06-13  6:27   ` Linus Walleij
2016-06-07  2:43 ` [PATCH 4/9] pinctrl: lpc18xx: " Paul Gortmaker
2016-06-13  6:28   ` Linus Walleij
2016-06-07  2:43 ` [PATCH 5/9] pinctrl: amd: " Paul Gortmaker
2016-06-13  6:29   ` Linus Walleij
2016-06-07  2:43 ` [PATCH 6/9] pinctrl: palmas: " Paul Gortmaker
2016-06-07  6:36   ` Laxman Dewangan
2016-06-07  2:43 ` [PATCH 7/9] pinctrl: zynq: " Paul Gortmaker
2016-06-07  2:54   ` Sören Brinkmann
2016-06-07  7:15   ` Michal Simek
2016-06-07  2:43 ` [PATCH 8/9] pinctrl: digicolor: " Paul Gortmaker
2016-06-07  6:13   ` Baruch Siach
2016-06-13  6:34     ` Linus Walleij
2016-06-13  6:33   ` Linus Walleij
2016-06-07  2:43 ` [PATCH 9/9] pinctrl: at91-pio4: " Paul Gortmaker
2016-06-08  6:27   ` Ludovic Desroches
2016-06-13  6:39   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).