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@xxxxxxxxxxxxxxxxxxx> --- 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@xxxxxxxxxxxxxxxxxx>"); MODULE_DESCRIPTION("Marvell Armada XP pinctrl driver"); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html