From ab30032c8abf1eaf3933772590f0cfd16f61b47f Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Fri, 15 Nov 2019 12:15:08 -0800 Subject: [PATCH] ion: msm: Move msm_ion probe to subsys_initcall_sync Move MSM ION to subsys_initcall_sync, so that the ION heaps can be instantiated earlier than what they currently are when all the drivers are builtin. This will reduce the number of probe retrials that can occur if clients attempt to use the MSM ION APIs before the MSM ION driver has probed. Change-Id: Ic308cb243541e0b1985544f1993eb83926452520 Signed-off-by: Isaac J. Manjarres --- drivers/staging/android/ion/heaps/msm_ion.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/heaps/msm_ion.c b/drivers/staging/android/ion/heaps/msm_ion.c index fd7cb9997bc0..ab84b2f2a5c6 100644 --- a/drivers/staging/android/ion/heaps/msm_ion.c +++ b/drivers/staging/android/ion/heaps/msm_ion.c @@ -577,6 +577,17 @@ static struct platform_driver msm_ion_driver = { .of_match_table = msm_ion_match_table, }, }; -module_platform_driver(msm_ion_driver); + +static int __init msm_ion_init(void) +{ + return platform_driver_register(&msm_ion_driver); +} +subsys_initcall_sync(msm_ion_init); + +static void __exit msm_ion_exit(void) +{ + return platform_driver_unregister(&msm_ion_driver); +} +module_exit(msm_ion_exit); MODULE_LICENSE("GPL v2");