[PATCH RFC/RFT 05/12] clk: samsung: exynos7885: Use platform_driver_probe() to avoid __refdata
Krzysztof Kozlowski
krzysztof.kozlowski at linaro.org
Wed Mar 5 13:43:40 PST 2025
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 at linaro.org>
---
drivers/clk/samsung/clk-exynos7885.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/samsung/clk-exynos7885.c b/drivers/clk/samsung/clk-exynos7885.c
index fc42251731edb6f8368d38638179056f8bc58335..0066c89e3515b852c7c6265322f8a1dc07af57ad 100644
--- a/drivers/clk/samsung/clk-exynos7885.c
+++ b/drivers/clk/samsung/clk-exynos7885.c
@@ -832,17 +832,16 @@ static const struct of_device_id exynos7885_cmu_of_match[] = {
},
};
-static struct platform_driver exynos7885_cmu_driver __refdata = {
+static struct platform_driver exynos7885_cmu_driver __initdata = {
.driver = {
.name = "exynos7885-cmu",
.of_match_table = exynos7885_cmu_of_match,
.suppress_bind_attrs = true,
},
- .probe = exynos7885_cmu_probe,
};
static int __init exynos7885_cmu_init(void)
{
- return platform_driver_register(&exynos7885_cmu_driver);
+ return platform_driver_probe(&exynos7885_cmu_driver, exynos7885_cmu_probe);
}
-core_initcall(exynos7885_cmu_init);
+subsys_initcall(exynos7885_cmu_init);
--
2.43.0
More information about the linux-arm-kernel
mailing list