linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers
@ 2019-06-17 18:40 Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 02/30] drivers: gpio: altera: use subsys_platform_driver() Enrico Weigelt, metux IT consult
                   ` (31 more replies)
  0 siblings, 32 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Add more helper macros for trivial driver init cases, similar to the
already existing module_platform_driver()+friends - now for those which
are initialized at other stages. Lots of drivers couldn't use the existing
macros, as they need to be called at different init stages, eg. subsys,
postcore, arch.

This helps to further reduce driver init boilerplate.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 include/linux/platform_device.h | 51 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index beb25f2..5f3a967 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -259,6 +259,57 @@ static inline void platform_set_drvdata(struct platform_device *pdev,
 } \
 module_exit(__platform_driver##_exit);
 
+/* postcore_platform_driver() - Helper macro for drivers that don't do
+ * anything special in module init/exit.  This eliminates a lot of
+ * boilerplate.  Each module may only use this macro once, and
+ * calling it replaces postcore_initcall() and module_exit()
+ */
+#define postcore_platform_driver(__platform_driver) \
+static int __init __platform_driver##_init(void) \
+{ \
+	return platform_driver_register(&(__platform_driver)); \
+} \
+postcore_initcall(__platform_driver##_init); \
+static void __exit __platform_driver##_exit(void) \
+{ \
+	platform_driver_unregister(&(__platform_driver)); \
+} \
+module_exit(__platform_driver##_exit);
+
+/* subsys_platform_driver() - Helper macro for drivers that don't do
+ * anything special in module init/exit.  This eliminates a lot of
+ * boilerplate.  Each module may only use this macro once, and
+ * calling it replaces subsys_initcall() and module_exit()
+ */
+#define subsys_platform_driver(__platform_driver) \
+static int __init __platform_driver##_init(void) \
+{ \
+	return platform_driver_register(&(__platform_driver)); \
+} \
+subsys_initcall(__platform_driver##_init); \
+static void __exit __platform_driver##_exit(void) \
+{ \
+	platform_driver_unregister(&(__platform_driver)); \
+} \
+module_exit(__platform_driver##_exit);
+
+/* arch_platform_driver() - Helper macro for drivers that don't do
+ * anything special in module init/exit.  This eliminates a lot of
+ * boilerplate.  Each module may only use this macro once, and
+ * calling it replaces arch_initcall() and module_exit()
+ */
+#define arch_platform_driver(__platform_driver) \
+static int __init __platform_driver##_init(void) \
+{ \
+	return platform_driver_register(&(__platform_driver)); \
+} \
+arch_initcall(__platform_driver##_init); \
+static void __exit __platform_driver##_exit(void) \
+{ \
+	platform_driver_unregister(&(__platform_driver)); \
+} \
+module_exit(__platform_driver##_exit);
+
 /* builtin_platform_driver_probe() - Helper macro for drivers that don't do
  * anything special in device init.  This eliminates some boilerplate.  Each
  * driver may only use this macro once, and using it replaces device_initcall.
-- 
1.9.1


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

* [PATCH 02/30] drivers: gpio: altera: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 03/30] drivers: gpio: da9055: " Enrico Weigelt, metux IT consult
                   ` (30 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-altera.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
index e088b90..b757c650 100644
--- a/drivers/gpio/gpio-altera.c
+++ b/drivers/gpio/gpio-altera.c
@@ -342,18 +342,7 @@ static int altera_gpio_remove(struct platform_device *pdev)
 	.probe		= altera_gpio_probe,
 	.remove		= altera_gpio_remove,
 };
-
-static int __init altera_gpio_init(void)
-{
-	return platform_driver_register(&altera_gpio_driver);
-}
-subsys_initcall(altera_gpio_init);
-
-static void __exit altera_gpio_exit(void)
-{
-	platform_driver_unregister(&altera_gpio_driver);
-}
-module_exit(altera_gpio_exit);
+subsys_platform_driver(altera_gpio_driver);
 
 MODULE_AUTHOR("Tien Hock Loh <thloh@altera.com>");
 MODULE_DESCRIPTION("Altera GPIO driver");
-- 
1.9.1


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

* [PATCH 03/30] drivers: gpio: da9055: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 02/30] drivers: gpio: altera: use subsys_platform_driver() Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 04/30] drivers: gpio: htc-egpio: " Enrico Weigelt, metux IT consult
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-da9055.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c
index 6ad0c37..d93f8ba 100644
--- a/drivers/gpio/gpio-da9055.c
+++ b/drivers/gpio/gpio-da9055.c
@@ -163,18 +163,7 @@ static int da9055_gpio_probe(struct platform_device *pdev)
 		.name	= "da9055-gpio",
 	},
 };
-
-static int __init da9055_gpio_init(void)
-{
-	return platform_driver_register(&da9055_gpio_driver);
-}
-subsys_initcall(da9055_gpio_init);
-
-static void __exit da9055_gpio_exit(void)
-{
-	platform_driver_unregister(&da9055_gpio_driver);
-}
-module_exit(da9055_gpio_exit);
+subsys_platform_driver(da9055_gpio_driver);
 
 MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
 MODULE_DESCRIPTION("DA9055 GPIO Device Driver");
-- 
1.9.1


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

* [PATCH 04/30] drivers: gpio: htc-egpio: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 02/30] drivers: gpio: altera: use subsys_platform_driver() Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 03/30] drivers: gpio: da9055: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 05/30] drivers: gpio: lynxpoint: " Enrico Weigelt, metux IT consult
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-htc-egpio.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-htc-egpio.c b/drivers/gpio/gpio-htc-egpio.c
index 9d3ac51..cc7a655 100644
--- a/drivers/gpio/gpio-htc-egpio.c
+++ b/drivers/gpio/gpio-htc-egpio.c
@@ -422,10 +422,4 @@ static int egpio_resume(struct platform_device *pdev)
 	.suspend      = egpio_suspend,
 	.resume       = egpio_resume,
 };
-
-static int __init egpio_init(void)
-{
-	return platform_driver_probe(&egpio_driver, egpio_probe);
-}
-/* start early for dependencies */
-subsys_initcall(egpio_init);
+subsys_platform_driver(egpio_driver);
-- 
1.9.1


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

* [PATCH 05/30] drivers: gpio: lynxpoint: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (2 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 04/30] drivers: gpio: htc-egpio: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 06/30] drivers: gpio: lantiq: " Enrico Weigelt, metux IT consult
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-lynxpoint.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c
index 31b4a09..8e6b998 100644
--- a/drivers/gpio/gpio-lynxpoint.c
+++ b/drivers/gpio/gpio-lynxpoint.c
@@ -438,19 +438,7 @@ static int lp_gpio_remove(struct platform_device *pdev)
 		.acpi_match_table = ACPI_PTR(lynxpoint_gpio_acpi_match),
 	},
 };
-
-static int __init lp_gpio_init(void)
-{
-	return platform_driver_register(&lp_gpio_driver);
-}
-
-static void __exit lp_gpio_exit(void)
-{
-	platform_driver_unregister(&lp_gpio_driver);
-}
-
-subsys_initcall(lp_gpio_init);
-module_exit(lp_gpio_exit);
+subsys_platform_driver(lp_gpio_driver);
 
 MODULE_AUTHOR("Mathias Nyman (Intel)");
 MODULE_DESCRIPTION("GPIO interface for Intel Lynxpoint");
-- 
1.9.1


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

* [PATCH 06/30] drivers: gpio: lantiq: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (3 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 05/30] drivers: gpio: lynxpoint: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 07/30] drivers: gpio: msic: " Enrico Weigelt, metux IT consult
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-mm-lantiq.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpio/gpio-mm-lantiq.c b/drivers/gpio/gpio-mm-lantiq.c
index b0754fe..3e5ef46 100644
--- a/drivers/gpio/gpio-mm-lantiq.c
+++ b/drivers/gpio/gpio-mm-lantiq.c
@@ -146,16 +146,4 @@ static int ltq_mm_remove(struct platform_device *pdev)
 		.of_match_table = ltq_mm_match,
 	},
 };
-
-static int __init ltq_mm_init(void)
-{
-	return platform_driver_register(&ltq_mm_driver);
-}
-
-subsys_initcall(ltq_mm_init);
-
-static void __exit ltq_mm_exit(void)
-{
-	platform_driver_unregister(&ltq_mm_driver);
-}
-module_exit(ltq_mm_exit);
+subsys_platform_driver(ltq_mm_driver);
-- 
1.9.1


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

* [PATCH 07/30] drivers: gpio: msic: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (4 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 06/30] drivers: gpio: lantiq: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-18  9:00   ` Andy Shevchenko
  2019-06-17 18:40 ` [PATCH 08/30] drivers: gpio: palmas: " Enrico Weigelt, metux IT consult
                   ` (25 subsequent siblings)
  31 siblings, 1 reply; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-msic.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
index 7e3c96e..5903ce3 100644
--- a/drivers/gpio/gpio-msic.c
+++ b/drivers/gpio/gpio-msic.c
@@ -306,9 +306,4 @@ static int platform_msic_gpio_probe(struct platform_device *pdev)
 	},
 	.probe		= platform_msic_gpio_probe,
 };
-
-static int __init platform_msic_gpio_init(void)
-{
-	return platform_driver_register(&platform_msic_gpio_driver);
-}
-subsys_initcall(platform_msic_gpio_init);
+subsys_platform_driver(platform_msic_gpio_driver);
-- 
1.9.1


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

* [PATCH 08/30] drivers: gpio: palmas: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (5 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 07/30] drivers: gpio: msic: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 09/30] drivers: gpio: rc5t583: " Enrico Weigelt, metux IT consult
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-palmas.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index e8e9029..4726200 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -195,9 +195,4 @@ static int palmas_gpio_probe(struct platform_device *pdev)
 	.driver.of_match_table = of_palmas_gpio_match,
 	.probe		= palmas_gpio_probe,
 };
-
-static int __init palmas_gpio_init(void)
-{
-	return platform_driver_register(&palmas_gpio_driver);
-}
-subsys_initcall(palmas_gpio_init);
+subsys_platform_driver(palmas_gpio_driver);
-- 
1.9.1


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

* [PATCH 09/30] drivers: gpio: rc5t583: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (6 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 08/30] drivers: gpio: palmas: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 10/30] drivers: gpio: spear-spics: " Enrico Weigelt, metux IT consult
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-rc5t583.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-rc5t583.c b/drivers/gpio/gpio-rc5t583.c
index 4fae3eb..d0dd3c2 100644
--- a/drivers/gpio/gpio-rc5t583.c
+++ b/drivers/gpio/gpio-rc5t583.c
@@ -133,9 +133,4 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)
 	},
 	.probe		= rc5t583_gpio_probe,
 };
-
-static int __init rc5t583_gpio_init(void)
-{
-	return platform_driver_register(&rc5t583_gpio_driver);
-}
-subsys_initcall(rc5t583_gpio_init);
+subsys_platform_driver(rc5t583_gpio_driver);
-- 
1.9.1


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

* [PATCH 10/30] drivers: gpio: spear-spics: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (7 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 09/30] drivers: gpio: rc5t583: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 11/30] drivers: gpio: stmpe: " Enrico Weigelt, metux IT consult
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-spear-spics.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c
index 6eca531..efb99f0 100644
--- a/drivers/gpio/gpio-spear-spics.c
+++ b/drivers/gpio/gpio-spear-spics.c
@@ -189,9 +189,4 @@ static int spics_gpio_probe(struct platform_device *pdev)
 		.of_match_table = spics_gpio_of_match,
 	},
 };
-
-static int __init spics_gpio_init(void)
-{
-	return platform_driver_register(&spics_gpio_driver);
-}
-subsys_initcall(spics_gpio_init);
+subsys_platform_driver(spics_gpio_driver);
-- 
1.9.1


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

* [PATCH 11/30] drivers: gpio: stmpe: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (8 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 10/30] drivers: gpio: spear-spics: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 12/30] drivers: gpio: stp-xway: " Enrico Weigelt, metux IT consult
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-stmpe.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index 65a2315..bb34f34 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -530,9 +530,4 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
 	},
 	.probe		= stmpe_gpio_probe,
 };
-
-static int __init stmpe_gpio_init(void)
-{
-	return platform_driver_register(&stmpe_gpio_driver);
-}
-subsys_initcall(stmpe_gpio_init);
+subsys_platform_driver(stmpe_gpio_driver);
-- 
1.9.1


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

* [PATCH 12/30] drivers: gpio: stp-xway: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (9 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 11/30] drivers: gpio: stmpe: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 13/30] drivers: gpio: tc3589x: " Enrico Weigelt, metux IT consult
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-stp-xway.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c
index 8a319d5..3f5c039 100644
--- a/drivers/gpio/gpio-stp-xway.c
+++ b/drivers/gpio/gpio-stp-xway.c
@@ -291,10 +291,4 @@ static int xway_stp_probe(struct platform_device *pdev)
 		.of_match_table = xway_stp_match,
 	},
 };
-
-static int __init xway_stp_init(void)
-{
-	return platform_driver_register(&xway_stp_driver);
-}
-
-subsys_initcall(xway_stp_init);
+subsys_platform_driver(xway_stp_driver);
-- 
1.9.1


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

* [PATCH 13/30] drivers: gpio: tc3589x: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (10 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 12/30] drivers: gpio: stp-xway: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 14/30] drivers: gpio: tegra: " Enrico Weigelt, metux IT consult
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-tc3589x.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 91a8ef8..8084698 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -360,9 +360,4 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
 	.driver.name	= "tc3589x-gpio",
 	.probe		= tc3589x_gpio_probe,
 };
-
-static int __init tc3589x_gpio_init(void)
-{
-	return platform_driver_register(&tc3589x_gpio_driver);
-}
-subsys_initcall(tc3589x_gpio_init);
+subsys_platform_driver(tc3589x_gpio_driver);
-- 
1.9.1


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

* [PATCH 14/30] drivers: gpio: tegra: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (11 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 13/30] drivers: gpio: tc3589x: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 15/30] drivers: gpio: tps6586x: " Enrico Weigelt, metux IT consult
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-tegra.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index f57bfc0..64dbba4 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -711,9 +711,4 @@ static int tegra_gpio_probe(struct platform_device *pdev)
 	},
 	.probe		= tegra_gpio_probe,
 };
-
-static int __init tegra_gpio_init(void)
-{
-	return platform_driver_register(&tegra_gpio_driver);
-}
-subsys_initcall(tegra_gpio_init);
+subsys_platform_driver(tegra_gpio_driver);
-- 
1.9.1


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

* [PATCH 15/30] drivers: gpio: tps6586x: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (12 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 14/30] drivers: gpio: tegra: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 16/30] drivers: gpio: tps65910: " Enrico Weigelt, metux IT consult
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-tps6586x.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c
index 9b6cc74..8f75718 100644
--- a/drivers/gpio/gpio-tps6586x.c
+++ b/drivers/gpio/gpio-tps6586x.c
@@ -122,9 +122,4 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
 	.driver.name	= "tps6586x-gpio",
 	.probe		= tps6586x_gpio_probe,
 };
-
-static int __init tps6586x_gpio_init(void)
-{
-	return platform_driver_register(&tps6586x_gpio_driver);
-}
-subsys_initcall(tps6586x_gpio_init);
+subsys_platform_driver(tps6586x_gpio_driver);
-- 
1.9.1


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

* [PATCH 16/30] drivers: gpio: tps65910: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (13 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 15/30] drivers: gpio: tps6586x: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 17/30] drivers: gpio: twl4030: " Enrico Weigelt, metux IT consult
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-tps65910.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
index 0c785b0..c618cd2 100644
--- a/drivers/gpio/gpio-tps65910.c
+++ b/drivers/gpio/gpio-tps65910.c
@@ -181,9 +181,4 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
 	.driver.name    = "tps65910-gpio",
 	.probe		= tps65910_gpio_probe,
 };
-
-static int __init tps65910_gpio_init(void)
-{
-	return platform_driver_register(&tps65910_gpio_driver);
-}
-subsys_initcall(tps65910_gpio_init);
+subsys_platform_driver(tps65910_gpio_driver);
-- 
1.9.1


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

* [PATCH 17/30] drivers: gpio: twl4030: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (14 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 16/30] drivers: gpio: tps65910: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:40 ` [PATCH 18/30] drivers: gpio: wm831x: " Enrico Weigelt, metux IT consult
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-twl4030.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index fbfb648..0c9a86f 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -633,18 +633,7 @@ static int gpio_twl4030_remove(struct platform_device *pdev)
 	.probe		= gpio_twl4030_probe,
 	.remove		= gpio_twl4030_remove,
 };
-
-static int __init gpio_twl4030_init(void)
-{
-	return platform_driver_register(&gpio_twl4030_driver);
-}
-subsys_initcall(gpio_twl4030_init);
-
-static void __exit gpio_twl4030_exit(void)
-{
-	platform_driver_unregister(&gpio_twl4030_driver);
-}
-module_exit(gpio_twl4030_exit);
+subsys_platform_driver(gpio_twl4030_driver);
 
 MODULE_AUTHOR("Texas Instruments, Inc.");
 MODULE_DESCRIPTION("GPIO interface for TWL4030");
-- 
1.9.1


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

* [PATCH 18/30] drivers: gpio: wm831x: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (15 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 17/30] drivers: gpio: twl4030: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:40 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 19/30] drivers: gpio: wm8350: " Enrico Weigelt, metux IT consult
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-wm831x.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c
index a3a32a7..324f811 100644
--- a/drivers/gpio/gpio-wm831x.c
+++ b/drivers/gpio/gpio-wm831x.c
@@ -296,18 +296,7 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
 	.driver.name	= "wm831x-gpio",
 	.probe		= wm831x_gpio_probe,
 };
-
-static int __init wm831x_gpio_init(void)
-{
-	return platform_driver_register(&wm831x_gpio_driver);
-}
-subsys_initcall(wm831x_gpio_init);
-
-static void __exit wm831x_gpio_exit(void)
-{
-	platform_driver_unregister(&wm831x_gpio_driver);
-}
-module_exit(wm831x_gpio_exit);
+subsys_platform_driver(wm831x_gpio_driver);
 
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
 MODULE_DESCRIPTION("GPIO interface for WM831x PMICs");
-- 
1.9.1


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

* [PATCH 19/30] drivers: gpio: wm8350: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (16 preceding siblings ...)
  2019-06-17 18:40 ` [PATCH 18/30] drivers: gpio: wm831x: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 20/30] drivers: gpio: wm8994: " Enrico Weigelt, metux IT consult
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-wm8350.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-wm8350.c b/drivers/gpio/gpio-wm8350.c
index 460f0a4..21a3191 100644
--- a/drivers/gpio/gpio-wm8350.c
+++ b/drivers/gpio/gpio-wm8350.c
@@ -137,18 +137,7 @@ static int wm8350_gpio_probe(struct platform_device *pdev)
 	.driver.name	= "wm8350-gpio",
 	.probe		= wm8350_gpio_probe,
 };
-
-static int __init wm8350_gpio_init(void)
-{
-	return platform_driver_register(&wm8350_gpio_driver);
-}
-subsys_initcall(wm8350_gpio_init);
-
-static void __exit wm8350_gpio_exit(void)
-{
-	platform_driver_unregister(&wm8350_gpio_driver);
-}
-module_exit(wm8350_gpio_exit);
+subsys_platform_driver(wm8350_gpio_driver);
 
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
 MODULE_DESCRIPTION("GPIO interface for WM8350 PMICs");
-- 
1.9.1


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

* [PATCH 20/30] drivers: gpio: wm8994: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (17 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 19/30] drivers: gpio: wm8350: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 21/30] drivers: gpio: xilinx: " Enrico Weigelt, metux IT consult
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-wm8994.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index 9af89cf..d9f4572 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -296,18 +296,7 @@ static int wm8994_gpio_probe(struct platform_device *pdev)
 	.driver.name	= "wm8994-gpio",
 	.probe		= wm8994_gpio_probe,
 };
-
-static int __init wm8994_gpio_init(void)
-{
-	return platform_driver_register(&wm8994_gpio_driver);
-}
-subsys_initcall(wm8994_gpio_init);
-
-static void __exit wm8994_gpio_exit(void)
-{
-	platform_driver_unregister(&wm8994_gpio_driver);
-}
-module_exit(wm8994_gpio_exit);
+subsys_platform_driver(wm8994_gpio_driver);
 
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
 MODULE_DESCRIPTION("GPIO interface for WM8994");
-- 
1.9.1


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

* [PATCH 21/30] drivers: gpio: xilinx: use subsys_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (18 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 20/30] drivers: gpio: wm8994: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 22/30] drivers: gpio: em: use postcore_platform_driver() Enrico Weigelt, metux IT consult
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-xilinx.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index 32944eb..255facc 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -376,19 +376,7 @@ static int xgpio_probe(struct platform_device *pdev)
 			.of_match_table	= xgpio_of_match,
 	},
 };
-
-static int __init xgpio_init(void)
-{
-	return platform_driver_register(&xgpio_plat_driver);
-}
-
-subsys_initcall(xgpio_init);
-
-static void __exit xgpio_exit(void)
-{
-	platform_driver_unregister(&xgpio_plat_driver);
-}
-module_exit(xgpio_exit);
+subsys_platform_driver(xgpio_plat_driver);
 
 MODULE_AUTHOR("Xilinx, Inc.");
 MODULE_DESCRIPTION("Xilinx GPIO driver");
-- 
1.9.1


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

* [PATCH 22/30] drivers: gpio: em: use postcore_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (19 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 21/30] drivers: gpio: xilinx: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 23/30] drivers: gpio: ep93xx: " Enrico Weigelt, metux IT consult
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
postcore_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-em.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index 84a7375..8b8037c 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -396,18 +396,7 @@ static int em_gio_remove(struct platform_device *pdev)
 		.of_match_table = em_gio_dt_ids,
 	}
 };
-
-static int __init em_gio_init(void)
-{
-	return platform_driver_register(&em_gio_device_driver);
-}
-postcore_initcall(em_gio_init);
-
-static void __exit em_gio_exit(void)
-{
-	platform_driver_unregister(&em_gio_device_driver);
-}
-module_exit(em_gio_exit);
+postcore_platform_driver(em_gio_device_driver);
 
 MODULE_AUTHOR("Magnus Damm");
 MODULE_DESCRIPTION("Renesas Emma Mobile GIO Driver");
-- 
1.9.1


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

* [PATCH 23/30] drivers: gpio: ep93xx: use postcore_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (20 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 22/30] drivers: gpio: em: use postcore_platform_driver() Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 24/30] drivers: gpio: mxs: " Enrico Weigelt, metux IT consult
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
postcore_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-ep93xx.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
index 71728d6..d4dfb50 100644
--- a/drivers/gpio/gpio-ep93xx.c
+++ b/drivers/gpio/gpio-ep93xx.c
@@ -429,12 +429,7 @@ static int ep93xx_gpio_probe(struct platform_device *pdev)
 	},
 	.probe		= ep93xx_gpio_probe,
 };
-
-static int __init ep93xx_gpio_init(void)
-{
-	return platform_driver_register(&ep93xx_gpio_driver);
-}
-postcore_initcall(ep93xx_gpio_init);
+postcore_platform_driver(ep93xx_gpio_driver);
 
 MODULE_AUTHOR("Ryan Mallon <ryan@bluewatersys.com> "
 		"H Hartley Sweeten <hsweeten@visionengravers.com>");
-- 
1.9.1


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

* [PATCH 24/30] drivers: gpio: mxs: use postcore_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (21 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 23/30] drivers: gpio: ep93xx: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 25/30] drivers: gpio: omap: " Enrico Weigelt, metux IT consult
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
postcore_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-mxs.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index 5e5437a..e2f54b8 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -369,12 +369,7 @@ static int mxs_gpio_probe(struct platform_device *pdev)
 	.probe		= mxs_gpio_probe,
 	.id_table	= mxs_gpio_ids,
 };
-
-static int __init mxs_gpio_init(void)
-{
-	return platform_driver_register(&mxs_gpio_driver);
-}
-postcore_initcall(mxs_gpio_init);
+postcore_platform_driver(mxs_gpio_driver);
 
 MODULE_AUTHOR("Freescale Semiconductor, "
 	      "Daniel Mack <danielncaiaq.de>, "
-- 
1.9.1


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

* [PATCH 25/30] drivers: gpio: omap: use postcore_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (22 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 24/30] drivers: gpio: mxs: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 26/30] drivers: gpio: zynq: " Enrico Weigelt, metux IT consult
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
postcore_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-omap.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 16289ba..3ea02d3 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1693,17 +1693,7 @@ static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
  * machine_init functions access gpio APIs.
  * Hence omap_gpio_drv_reg() is a postcore_initcall.
  */
-static int __init omap_gpio_drv_reg(void)
-{
-	return platform_driver_register(&omap_gpio_driver);
-}
-postcore_initcall(omap_gpio_drv_reg);
-
-static void __exit omap_gpio_exit(void)
-{
-	platform_driver_unregister(&omap_gpio_driver);
-}
-module_exit(omap_gpio_exit);
+postcore_platform_driver(omap_gpio_driver);
 
 MODULE_DESCRIPTION("omap gpio driver");
 MODULE_ALIAS("platform:gpio-omap");
-- 
1.9.1


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

* [PATCH 26/30] drivers: gpio: zynq: use postcore_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (23 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 25/30] drivers: gpio: omap: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 27/30] drivers: gpio: iop: use arch_platform_driver() Enrico Weigelt, metux IT consult
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
postcore_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-zynq.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index f241b6c..30ad4ee 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -952,22 +952,7 @@ static int zynq_gpio_remove(struct platform_device *pdev)
 	.remove = zynq_gpio_remove,
 };
 
-/**
- * zynq_gpio_init - Initial driver registration call
- *
- * Return: value from platform_driver_register
- */
-static int __init zynq_gpio_init(void)
-{
-	return platform_driver_register(&zynq_gpio_driver);
-}
-postcore_initcall(zynq_gpio_init);
-
-static void __exit zynq_gpio_exit(void)
-{
-	platform_driver_unregister(&zynq_gpio_driver);
-}
-module_exit(zynq_gpio_exit);
+postcore_platform_driver(zynq_gpio_driver);
 
 MODULE_AUTHOR("Xilinx Inc.");
 MODULE_DESCRIPTION("Zynq GPIO driver");
-- 
1.9.1


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

* [PATCH 27/30] drivers: gpio: iop: use arch_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (24 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 26/30] drivers: gpio: zynq: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 28/30] drivers: gpio: mpc8xxx: " Enrico Weigelt, metux IT consult
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
arch_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-iop.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-iop.c b/drivers/gpio/gpio-iop.c
index e355c59..651ab5a 100644
--- a/drivers/gpio/gpio-iop.c
+++ b/drivers/gpio/gpio-iop.c
@@ -46,12 +46,7 @@ static int iop3xx_gpio_probe(struct platform_device *pdev)
 	},
 	.probe = iop3xx_gpio_probe,
 };
-
-static int __init iop3xx_gpio_init(void)
-{
-	return platform_driver_register(&iop3xx_gpio_driver);
-}
-arch_initcall(iop3xx_gpio_init);
+arch_platform_driver(iop3xx_gpio_init);
 
 MODULE_DESCRIPTION("GPIO handling for Intel IOP3xx processors");
 MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>");
-- 
1.9.1


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

* [PATCH 28/30] drivers: gpio: mpc8xxx: use arch_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (25 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 27/30] drivers: gpio: iop: use arch_platform_driver() Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 29/30] drivers: gpio: max7300: " Enrico Weigelt, metux IT consult
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
arch_platform_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-mpc8xxx.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index c8673a5..6eef9b8 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -408,10 +408,4 @@ static int mpc8xxx_remove(struct platform_device *pdev)
 		.of_match_table	= mpc8xxx_gpio_ids,
 	},
 };
-
-static int __init mpc8xxx_init(void)
-{
-	return platform_driver_register(&mpc8xxx_plat_driver);
-}
-
-arch_initcall(mpc8xxx_init);
+arch_platform_driver(mpc8xxx_plat_driver);
-- 
1.9.1


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

* [PATCH 29/30] drivers: gpio: max7300: use arch_platform_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (26 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 28/30] drivers: gpio: mpc8xxx: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-17 18:41 ` [PATCH 30/30] drivers: gpio: max732x: use subsys_i2c_driver() Enrico Weigelt, metux IT consult
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_i2c_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-max7300.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-max7300.c b/drivers/gpio/gpio-max7300.c
index 1ae9ba8..36d5afa 100644
--- a/drivers/gpio/gpio-max7300.c
+++ b/drivers/gpio/gpio-max7300.c
@@ -70,18 +70,7 @@ static int max7300_remove(struct i2c_client *client)
 	.remove = max7300_remove,
 	.id_table = max7300_id,
 };
-
-static int __init max7300_init(void)
-{
-	return i2c_add_driver(&max7300_driver);
-}
-subsys_initcall(max7300_init);
-
-static void __exit max7300_exit(void)
-{
-	i2c_del_driver(&max7300_driver);
-}
-module_exit(max7300_exit);
+subsys_i2c_driver(max7300_driver);
 
 MODULE_AUTHOR("Wolfram Sang");
 MODULE_LICENSE("GPL v2");
-- 
1.9.1


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

* [PATCH 30/30] drivers: gpio: max732x: use subsys_i2c_driver()
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (27 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 29/30] drivers: gpio: max7300: " Enrico Weigelt, metux IT consult
@ 2019-06-17 18:41 ` Enrico Weigelt, metux IT consult
  2019-06-18  8:57 ` [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Andy Shevchenko
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-17 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: thloh, linus.walleij, bgolaszewski, andriy.shevchenko, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_i2c_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-max732x.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
index 5e4102e..c340883 100644
--- a/drivers/gpio/gpio-max732x.c
+++ b/drivers/gpio/gpio-max732x.c
@@ -756,21 +756,10 @@ static int max732x_remove(struct i2c_client *client)
 	.remove		= max732x_remove,
 	.id_table	= max732x_id,
 };
-
-static int __init max732x_init(void)
-{
-	return i2c_add_driver(&max732x_driver);
-}
 /* register after i2c postcore initcall and before
  * subsys initcalls that may rely on these GPIOs
  */
-subsys_initcall(max732x_init);
-
-static void __exit max732x_exit(void)
-{
-	i2c_del_driver(&max732x_driver);
-}
-module_exit(max732x_exit);
+subsys_i2c_driver(max732x_driver);
 
 MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>");
 MODULE_DESCRIPTION("GPIO expander driver for MAX732X");
-- 
1.9.1


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

* Re: [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (28 preceding siblings ...)
  2019-06-17 18:41 ` [PATCH 30/30] drivers: gpio: max732x: use subsys_i2c_driver() Enrico Weigelt, metux IT consult
@ 2019-06-18  8:57 ` Andy Shevchenko
  2019-06-25  9:18 ` Linus Walleij
  2019-06-26  6:14 ` Uwe Kleine-König
  31 siblings, 0 replies; 35+ messages in thread
From: Andy Shevchenko @ 2019-06-18  8:57 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: linux-kernel, thloh, linus.walleij, bgolaszewski, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

On Mon, Jun 17, 2019 at 08:40:42PM +0200, Enrico Weigelt, metux IT consult wrote:
> From: Enrico Weigelt <info@metux.net>
> 
> Add more helper macros for trivial driver init cases, similar to the
> already existing module_platform_driver()+friends - now for those which
> are initialized at other stages. Lots of drivers couldn't use the existing
> macros, as they need to be called at different init stages, eg. subsys,
> postcore, arch.
> 
> This helps to further reduce driver init boilerplate.

> +/* postcore_platform_driver() - Helper macro for drivers that don't do
> + * anything special in module init/exit.  This eliminates a lot of
> + * boilerplate.  Each module may only use this macro once, and
> + * calling it replaces postcore_initcall() and module_exit()
> + */

Perhaps you meant kernel-doc format?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 07/30] drivers: gpio: msic: use subsys_platform_driver()
  2019-06-17 18:40 ` [PATCH 07/30] drivers: gpio: msic: " Enrico Weigelt, metux IT consult
@ 2019-06-18  9:00   ` Andy Shevchenko
  0 siblings, 0 replies; 35+ messages in thread
From: Andy Shevchenko @ 2019-06-18  9:00 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: linux-kernel, thloh, linus.walleij, bgolaszewski, shawnguo,
	s.hauer, kernel, festevam, linux-imx, grygorii.strashko,
	ssantosh, khilman, mcoquelin.stm32, alexandre.torgue, linux-gpio,
	linux-omap, linux-tegra, patches

On Mon, Jun 17, 2019 at 08:40:48PM +0200, Enrico Weigelt, metux IT consult wrote:
> From: Enrico Weigelt <info@metux.net>
> 
> Reduce driver init boilerplate by using the new
> subsys_platform_driver() macro.

> --- a/drivers/gpio/gpio-msic.c
> +++ b/drivers/gpio/gpio-msic.c
> @@ -306,9 +306,4 @@ static int platform_msic_gpio_probe(struct platform_device *pdev)
>  	},
>  	.probe		= platform_msic_gpio_probe,
>  };
> -
> -static int __init platform_msic_gpio_init(void)
> -{
> -	return platform_driver_register(&platform_msic_gpio_driver);
> -}
> -subsys_initcall(platform_msic_gpio_init);
> +subsys_platform_driver(platform_msic_gpio_driver);

How did you test this? Had you even compiled it?

P.S. Perhaps it makes #include <linux/init.h> redundant.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (29 preceding siblings ...)
  2019-06-18  8:57 ` [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Andy Shevchenko
@ 2019-06-25  9:18 ` Linus Walleij
  2019-06-26  6:14 ` Uwe Kleine-König
  31 siblings, 0 replies; 35+ messages in thread
From: Linus Walleij @ 2019-06-25  9:18 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, Greg KH
  Cc: linux-kernel, Tien Hock Loh, Bartosz Golaszewski,
	Andy Shevchenko, Shawn Guo, Sascha Hauer, Sascha Hauer,
	Fabio Estevam, NXP Linux Team, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Maxime Coquelin,
	Alexandre TORGUE, open list:GPIO SUBSYSTEM, Linux-OMAP,
	linux-tegra, patches, Rafael J. Wysocki

On Mon, Jun 17, 2019 at 8:41 PM Enrico Weigelt, metux IT consult
<info@metux.net> wrote:

> From: Enrico Weigelt <info@metux.net>
>
> Add more helper macros for trivial driver init cases, similar to the
> already existing module_platform_driver()+friends - now for those which
> are initialized at other stages. Lots of drivers couldn't use the existing
> macros, as they need to be called at different init stages, eg. subsys,
> postcore, arch.
>
> This helps to further reduce driver init boilerplate.
>
> Signed-off-by: Enrico Weigelt <info@metux.net>

You need to send this to Greg as device core maintainer.
Possibly to Rafael as well, he did a very intersting rework
on device dependencies with device links.

While in general I agree that this diets down a lot of duplicate
code that we have done the same way over and over, there
is the issue that we don't want any drivers to do this mockery
and instead use deferred probe and ultimately just probe in the
right order.

I think device links were supposed to fix this up, but it indeed
assumes that you know of these dependencies before you
start probing the first driver, and often you do not, unless the
hardware description explicitly encodes that. And that is one
big problem.

If we should do this, device core changes must be merged or
explicitly ACKed first.

Yours,
Linus Walleij

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

* Re: [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers
  2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
                   ` (30 preceding siblings ...)
  2019-06-25  9:18 ` Linus Walleij
@ 2019-06-26  6:14 ` Uwe Kleine-König
  2019-06-26 17:27   ` Enrico Weigelt, metux IT consult
  31 siblings, 1 reply; 35+ messages in thread
From: Uwe Kleine-König @ 2019-06-26  6:14 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: linux-kernel, grygorii.strashko, mcoquelin.stm32, thloh,
	festevam, linus.walleij, khilman, patches, bgolaszewski,
	linux-omap, linux-gpio, linux-imx, kernel, ssantosh, linux-tegra,
	andriy.shevchenko, shawnguo, s.hauer, alexandre.torgue

Hello,

On Mon, Jun 17, 2019 at 08:40:42PM +0200, Enrico Weigelt, metux IT consult wrote:
> From: Enrico Weigelt <info@metux.net>
> 
> Add more helper macros for trivial driver init cases, similar to the
> already existing module_platform_driver()+friends - now for those which
> are initialized at other stages. Lots of drivers couldn't use the existing
> macros, as they need to be called at different init stages, eg. subsys,
> postcore, arch.
> 
> This helps to further reduce driver init boilerplate.
> 
> Signed-off-by: Enrico Weigelt <info@metux.net>
> ---
>  include/linux/platform_device.h | 51 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
> 
> diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
> index beb25f2..5f3a967 100644
> --- a/include/linux/platform_device.h
> +++ b/include/linux/platform_device.h
> @@ -259,6 +259,57 @@ static inline void platform_set_drvdata(struct platform_device *pdev,
>  } \
>  module_exit(__platform_driver##_exit);
>  
> +/* postcore_platform_driver() - Helper macro for drivers that don't do
> + * anything special in module init/exit.  This eliminates a lot of
> + * boilerplate.  Each module may only use this macro once, and
> + * calling it replaces postcore_initcall() and module_exit()
> + */
> +#define postcore_platform_driver(__platform_driver) \
> +static int __init __platform_driver##_init(void) \
> +{ \
> +	return platform_driver_register(&(__platform_driver)); \
> +} \
> +postcore_initcall(__platform_driver##_init); \
> +static void __exit __platform_driver##_exit(void) \
> +{ \
> +	platform_driver_unregister(&(__platform_driver)); \
> +} \
> +module_exit(__platform_driver##_exit);
> +
> +/* subsys_platform_driver() - Helper macro for drivers that don't do
> + * anything special in module init/exit.  This eliminates a lot of
> + * boilerplate.  Each module may only use this macro once, and
> + * calling it replaces subsys_initcall() and module_exit()
> + */
> +#define subsys_platform_driver(__platform_driver) \
> +static int __init __platform_driver##_init(void) \
> +{ \
> +	return platform_driver_register(&(__platform_driver)); \
> +} \
> +subsys_initcall(__platform_driver##_init); \
> +static void __exit __platform_driver##_exit(void) \
> +{ \
> +	platform_driver_unregister(&(__platform_driver)); \
> +} \
> +module_exit(__platform_driver##_exit);

Would it make sense to do something like:

	#define __module_platform_driver(__platform_driver, __initlvl) \
	static int __init __platform_driver##_init(void) \
	{ \
		return platform_driver_register(&(__platform_driver)); \
	} \
	__initlvl ## _initcall(__platform_driver##_init); \
	static void __exit __platform_driver##_exit(void) \
	{ \
		platform_driver_unregister(&(__platform_driver)); \
	} \
	module_exit(__platform_driver##_exit);

	#define postcore_platform_driver(__platform_driver) __module_platform_driver(__platform_driver, postcore)
	#define subsys_platform_driver(__platform_driver) __module_platform_driver(__platform_driver, subsys)
	...

Which would be more compact and makes the difference between these
macros a bit more obvious.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers
  2019-06-26  6:14 ` Uwe Kleine-König
@ 2019-06-26 17:27   ` Enrico Weigelt, metux IT consult
  0 siblings, 0 replies; 35+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-26 17:27 UTC (permalink / raw)
  To: Uwe Kleine-König, Enrico Weigelt, metux IT consult
  Cc: linux-kernel, grygorii.strashko, mcoquelin.stm32, thloh,
	festevam, linus.walleij, khilman, patches, bgolaszewski,
	linux-omap, linux-gpio, linux-imx, kernel, ssantosh, linux-tegra,
	andriy.shevchenko, shawnguo, s.hauer, alexandre.torgue

On 26.06.19 08:14, Uwe Kleine-König wrote:
Hi,

> Would it make sense to do something like:
>
> 	#define __module_platform_driver(__platform_driver, __initlvl) \
> 	static int __init __platform_driver##_init(void) \
> 	{ \
> 		return platform_driver_register(&(__platform_driver)); \
> 	} \
> 	__initlvl ## _initcall(__platform_driver##_init); \
> 	static void __exit __platform_driver##_exit(void) \
> 	{ \
> 		platform_driver_unregister(&(__platform_driver)); \
> 	} \
> 	module_exit(__platform_driver##_exit);
>
> 	#define postcore_platform_driver(__platform_driver)
__module_platform_driver(__platform_driver, postcore)
> 	#define subsys_platform_driver(__platform_driver)
__module_platform_driver(__platform_driver, subsys)
> 	...
>
> Which would be more compact and makes the difference between these
> macros a bit more obvious.
yeah, could do that, but not sure whether it's really good for
readability when we have so many nested macros :p

OTOH, I didn't want to touch the existing macros for now, just trim down
the actual init boilerplate, postponing further compactions for later.

--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

end of thread, other threads:[~2019-06-26 17:33 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 18:40 [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 02/30] drivers: gpio: altera: use subsys_platform_driver() Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 03/30] drivers: gpio: da9055: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 04/30] drivers: gpio: htc-egpio: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 05/30] drivers: gpio: lynxpoint: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 06/30] drivers: gpio: lantiq: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 07/30] drivers: gpio: msic: " Enrico Weigelt, metux IT consult
2019-06-18  9:00   ` Andy Shevchenko
2019-06-17 18:40 ` [PATCH 08/30] drivers: gpio: palmas: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 09/30] drivers: gpio: rc5t583: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 10/30] drivers: gpio: spear-spics: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 11/30] drivers: gpio: stmpe: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 12/30] drivers: gpio: stp-xway: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 13/30] drivers: gpio: tc3589x: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 14/30] drivers: gpio: tegra: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 15/30] drivers: gpio: tps6586x: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 16/30] drivers: gpio: tps65910: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 17/30] drivers: gpio: twl4030: " Enrico Weigelt, metux IT consult
2019-06-17 18:40 ` [PATCH 18/30] drivers: gpio: wm831x: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 19/30] drivers: gpio: wm8350: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 20/30] drivers: gpio: wm8994: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 21/30] drivers: gpio: xilinx: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 22/30] drivers: gpio: em: use postcore_platform_driver() Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 23/30] drivers: gpio: ep93xx: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 24/30] drivers: gpio: mxs: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 25/30] drivers: gpio: omap: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 26/30] drivers: gpio: zynq: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 27/30] drivers: gpio: iop: use arch_platform_driver() Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 28/30] drivers: gpio: mpc8xxx: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 29/30] drivers: gpio: max7300: " Enrico Weigelt, metux IT consult
2019-06-17 18:41 ` [PATCH 30/30] drivers: gpio: max732x: use subsys_i2c_driver() Enrico Weigelt, metux IT consult
2019-06-18  8:57 ` [PATCH 01/30] include: linux: platform_device: more helpers for declaring platform drivers Andy Shevchenko
2019-06-25  9:18 ` Linus Walleij
2019-06-26  6:14 ` Uwe Kleine-König
2019-06-26 17:27   ` Enrico Weigelt, metux IT consult

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