diff mbox

mfd: mt6397: convert to arch_initcall

Message ID 1450862711-22124-1-git-send-email-henryc.chen@mediatek.com (mailing list archive)
State New, archived
Headers show

Commit Message

Henry Chen Dec. 23, 2015, 9:25 a.m. UTC
Since pinctrl or regulator of mt6396 need to initialize earlier to avoid
probe deferring, also change the core driver to arch_init.

Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
---
 drivers/mfd/mt6397-core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Lee Jones Jan. 11, 2016, 5:49 a.m. UTC | #1
On Wed, 23 Dec 2015, Henry Chen wrote:

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

> Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
> ---
>  drivers/mfd/mt6397-core.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> index 1749c1c..af98b4b 100644
> --- a/drivers/mfd/mt6397-core.c
> +++ b/drivers/mfd/mt6397-core.c
> @@ -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");
diff mbox

Patch

diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 1749c1c..af98b4b 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -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");