From 03206e3b7585ab65ced180f9c6f09e8d36f8d4c2 Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Wed, 27 Jun 2018 17:32:38 -0700 Subject: [PATCH] spmi: spmi-pmic-arb-debug: Change the probe init order Currently, both the regular and debug spmi pmic arbiter devices are probed in the same initcall order (arch_init). This is fine. However, most of the sepolicy rules set in the userspace are for the PMIC devices under spmi-0 bus. If the debug spmi pmic arbiter device probes first and takes "spmi-0" name, then the sepolicy rules set will be broken. Fix it by changing the probe init order of debug spmi pmic arbiter device to module init. Change-Id: I145e78a205bc80f274d8d926353a88255a7f4167 Signed-off-by: Subbaraman Narayanamurthy --- drivers/spmi/spmi-pmic-arb-debug.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/spmi/spmi-pmic-arb-debug.c b/drivers/spmi/spmi-pmic-arb-debug.c index 5bcf02753319..e23188d1de60 100644 --- a/drivers/spmi/spmi-pmic-arb-debug.c +++ b/drivers/spmi/spmi-pmic-arb-debug.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. */ +/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. */ #include #include @@ -355,17 +355,7 @@ static struct platform_driver spmi_pmic_arb_debug_driver = { }, }; -int __init spmi_pmic_arb_debug_init(void) -{ - return platform_driver_register(&spmi_pmic_arb_debug_driver); -} -arch_initcall(spmi_pmic_arb_debug_init); - -static void __exit spmi_pmic_arb_debug_exit(void) -{ - platform_driver_unregister(&spmi_pmic_arb_debug_driver); -} -module_exit(spmi_pmic_arb_debug_exit); +module_platform_driver(spmi_pmic_arb_debug_driver); MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:spmi_pmic_arb_debug");