linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: pinctrl: Initialize Armada-XP GPIO/Pinctrl drivers at arch_initcall
@ 2015-05-12  2:39 Joshua Scott
  2015-05-12  7:18 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Joshua Scott @ 2015-05-12  2:39 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot, Patrice Chotard,
	Thomas Petazzoni, Fabian Frederick, Wolfram Sang
  Cc: linux-gpio, Chris Packham, Joshua Scott

The Armada-XP contains a set of GPIO pins. These pins may be used to take
other hardware out of reset. However, the drivers used are currently not
initialized until quite late in the boot process (module_platform_driver).

This patch replaces the use of module_platform_driver with arch_initcall
in the two drivers that are used to control the GPIO pins. This allows for
drivers using subsys_initcall or later to access to the pins.


Signed-off-by: Joshua Scott <joshua.scott@alliedtelesis.co.nz>
---
 drivers/gpio/gpio-mvebu.c                 | 13 ++++++++++++-
 drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 12 +++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 1a54205..3dd7e23 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -860,4 +860,15 @@ static struct platform_driver mvebu_gpio_driver = {
 	.suspend        = mvebu_gpio_suspend,
 	.resume         = mvebu_gpio_resume,
 };
-module_platform_driver(mvebu_gpio_driver);
+
+static int __init mvebu_gpio_driver_init(void)
+{
+	return platform_driver_register(&mvebu_gpio_driver);
+}
+arch_initcall(mvebu_gpio_driver_init);
+
+static void __exit mvebu_gpio_driver_exit(void)
+{
+	platform_driver_unregister(&mvebu_gpio_driver);
+}
+module_exit(mvebu_gpio_driver_exit);
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
index 578db9f..609c732 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
@@ -518,7 +518,17 @@ static struct platform_driver armada_xp_pinctrl_driver = {
 	.resume = armada_xp_pinctrl_resume,
 };
 
-module_platform_driver(armada_xp_pinctrl_driver);
+static int __init armada_xp_pinctrl_init(void)
+{
+	return platform_driver_register(&armada_xp_pinctrl_driver);
+}
+arch_initcall(armada_xp_pinctrl_init);
+
+static void __exit armada_xp_pinctrl_exit(void)
+{
+	platform_driver_unregister(&armada_xp_pinctrl_driver);
+}
+module_exit(armada_xp_pinctrl_exit);
 
 MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
 MODULE_DESCRIPTION("Marvell Armada XP pinctrl driver");
-- 
1.9.1


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

end of thread, other threads:[~2015-05-13  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-12  2:39 [PATCH] gpio: pinctrl: Initialize Armada-XP GPIO/Pinctrl drivers at arch_initcall Joshua Scott
2015-05-12  7:18 ` Thomas Petazzoni
2015-05-12 22:29   ` Joshua Scott
2015-05-13  7:42     ` Thomas Petazzoni

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