Message ID | 20250305-clk-samsung-ref-init-data-v1-8-a4e03a019306@linaro.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | clk: samsung: Use platform_driver_probe() to avoid __refdata | expand |
On Wed Mar 5, 2025 at 10:43 PM CET, Krzysztof Kozlowski wrote: > 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@linaro.org> Hi Krzysztof and apologies for the delay in testing. On my Exynos990 platforms this patch causes similar oopses to those sent by André (different places each boot). I am unable to get the logs from UART right now though (refactoring my testing setup). Apologies. So this bug seems to be platformwide :( Best regards, Igor
diff --git a/drivers/clk/samsung/clk-exynos990.c b/drivers/clk/samsung/clk-exynos990.c index 76f22a4a4631fadf400420b977f3f59f40f840c7..d00050d8765f25042698cbe6bfa06623931c7414 100644 --- a/drivers/clk/samsung/clk-exynos990.c +++ b/drivers/clk/samsung/clk-exynos990.c @@ -1504,18 +1504,17 @@ static const struct of_device_id exynos990_cmu_of_match[] = { { }, }; -static struct platform_driver exynos990_cmu_driver __refdata = { +static struct platform_driver exynos990_cmu_driver __initdata = { .driver = { .name = "exynos990-cmu", .of_match_table = exynos990_cmu_of_match, .suppress_bind_attrs = true, }, - .probe = exynos990_cmu_probe, }; static int __init exynos990_cmu_init(void) { - return platform_driver_register(&exynos990_cmu_driver); + return platform_driver_probe(&exynos990_cmu_driver, exynos990_cmu_probe); } -core_initcall(exynos990_cmu_init); +subsys_initcall(exynos990_cmu_init);
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@linaro.org> --- drivers/clk/samsung/clk-exynos990.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)