[PATCH RFC/RFT 01/12] clk: samsung: exynos2200: Use platform_driver_probe() to avoid __refdata
From: Krzysztof Kozlowski
Date: Wed Mar 05 2025 - 16:44:56 EST
Switch registering platform driver to platform_driver_probe(), so the
'struct platform_driver' can be properly discarded after init and there
won't be need of __refdata to silence DEBUG_SECTION_MISMATCH.
The change requires using subsys_initcall instead of core_initcall,
because no device drivers would bound in the latter, as required by
platform_driver_probe().
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
---
Testing needed.
My initial tests on Exynos5422 lead to weird, unrelated oopses, probably
because of multiple exynos5-subcmu devices. Not sure if applicable here,
but change of initcal might have actual impact.
---
drivers/clk/samsung/clk-exynos2200.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/samsung/clk-exynos2200.c b/drivers/clk/samsung/clk-exynos2200.c
index 151bdb35a46c42d0b50f48d47974065a892bbb5f..f1251d4f01781fd503f24189cc53b23e627ab5e1 100644
--- a/drivers/clk/samsung/clk-exynos2200.c
+++ b/drivers/clk/samsung/clk-exynos2200.c
@@ -3912,17 +3912,16 @@ static const struct of_device_id exynos2200_cmu_of_match[] = {
}, { }
};
-static struct platform_driver exynos2200_cmu_driver __refdata = {
+static struct platform_driver exynos2200_cmu_driver __initdata = {
.driver = {
.name = "exynos2200-cmu",
.of_match_table = exynos2200_cmu_of_match,
.suppress_bind_attrs = true,
},
- .probe = exynos2200_cmu_probe,
};
static int __init exynos2200_cmu_init(void)
{
- return platform_driver_register(&exynos2200_cmu_driver);
+ return platform_driver_probe(&exynos2200_cmu_driver, exynos2200_cmu_probe);
}
-core_initcall(exynos2200_cmu_init);
+subsys_initcall(exynos2200_cmu_init);
--
2.43.0