Skip to contentSkip to conversation

mfd: mt6397: convert to arch_initcall

PATCH In review Henry Chen 2 participants 2 messages Dec 23, 2015 – Jan 11, 2016

Subsystems (2)
lore
Share & tools
lore

Henry Chen

author
#0 lore raw

PATCH 1/1 mfd: mt6397: convert to arch_initcall

Since pinctrl or regulator of mt6396 need to initialize earlier to avoid probe deferring, also change the core driver to arch_init.

---
 drivers/mfd/mt6397-core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mfd/mt6397-core.c +5 -1
index 1749c1c..af98b4b 100644
@@ -285,7 +285,11 @@ static struct platform_driver mt6397_driver = {
 	},
 };
 
-module_platform_driver(mt6397_driver);
+static int __init mt6397_core_init(void)
+{
+	return platform_driver_register(&mt6397_driver);
+}
+arch_initcall(mt6397_core_init);
 
 MODULE_AUTHOR("Flora Fu, MediaTek");
 MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC");
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Henry Chen

Since pinctrl or regulator of mt6396 need to initialize earlier to avoid probe deferring, also change the core driver to arch_init.

This is exactly what deferring probe was designed for; so that you don't have to mess around with initcall ordering.

Quoted 22 lines
---
 drivers/mfd/mt6397-core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mfd/mt6397-core.c +5 -1
index 1749c1c..af98b4b 100644
@@ -285,7 +285,11 @@ static struct platform_driver mt6397_driver = {
 	},
 };
 
-module_platform_driver(mt6397_driver);
+static int __init mt6397_core_init(void)
+{
+	return platform_driver_register(&mt6397_driver);
+}
+arch_initcall(mt6397_core_init);
 
 MODULE_AUTHOR("Flora Fu, MediaTek");
 MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC");
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog