[PATCH 1/5] [RFC-HACK] pinctrl-single: init by postcore_initcall()

Tony Lindgren tony at atomide.com
Thu May 22 16:31:54 PDT 2014


* Christoph Fritz <chf.fritz at googlemail.com> [140522 16:07]:
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -2069,7 +2069,22 @@ static struct platform_driver pcs_driver = {
>  #endif
>  };
>  
> +#ifdef CONFIG_USE_OF
> +static int __init pcs_driver_drv_init(void)
> +{
> +       return platform_driver_register(&pcs_driver);
> +}
> +postcore_initcall(pcs_driver_drv_init);
> +
> +static void __exit pcs_driver_drv_exit(void)
> +{
> +       platform_driver_unregister(&pcs_driver);
> +}
> +module_exit(pcs_driver_drv_exit);
> +#else
>  module_platform_driver(pcs_driver);
> +#endif
> +

I would prefer to initialize all the drivers with module_init
and and if necessary, selected frameworks with subsys_initcall. 

In drivers/Makefile we do have painctrl before gpio, so this
too could be just module_init once the other drivers are fixed.

Regards,

Tony



More information about the linux-arm-kernel mailing list