Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource/drivers/nxp-stm: Fix section mismatches

Platform drivers can be probed after their init sections have been
discarded (e.g. on probe deferral or manual rebind through sysfs) so the
probe function must not live in init. Device managed resource actions
similarly cannot be discarded.

The "_probe" suffix of the driver structure name prevents modpost from
warning about this so replace it to catch any similar future issues.

Fixes: cec32ac75827 ("clocksource/drivers/nxp-timer: Add the System Timer Module for the s32gx platforms")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: stable@vger.kernel.org # 6.16
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/20251017054943.7195-1-johan@kernel.org

authored by

Johan Hovold and committed by
Daniel Lezcano
b452d2c9 62524f28

+9 -9
+9 -9
drivers/clocksource/timer-nxp-stm.c
··· 177 177 nxp_stm_clocksource_enable(cs); 178 178 } 179 179 180 - static void __init devm_clocksource_unregister(void *data) 180 + static void devm_clocksource_unregister(void *data) 181 181 { 182 182 struct stm_timer *stm_timer = data; 183 183 184 184 clocksource_unregister(&stm_timer->cs); 185 185 } 186 186 187 - static int __init nxp_stm_clocksource_init(struct device *dev, struct stm_timer *stm_timer, 188 - const char *name, void __iomem *base, struct clk *clk) 187 + static int nxp_stm_clocksource_init(struct device *dev, struct stm_timer *stm_timer, 188 + const char *name, void __iomem *base, struct clk *clk) 189 189 { 190 190 int ret; 191 191 ··· 296 296 nxp_stm_module_get(stm_timer); 297 297 } 298 298 299 - static int __init nxp_stm_clockevent_per_cpu_init(struct device *dev, struct stm_timer *stm_timer, 300 - const char *name, void __iomem *base, int irq, 301 - struct clk *clk, int cpu) 299 + static int nxp_stm_clockevent_per_cpu_init(struct device *dev, struct stm_timer *stm_timer, 300 + const char *name, void __iomem *base, int irq, 301 + struct clk *clk, int cpu) 302 302 { 303 303 stm_timer->base = base; 304 304 stm_timer->rate = clk_get_rate(clk); ··· 386 386 return IRQ_HANDLED; 387 387 } 388 388 389 - static int __init nxp_stm_timer_probe(struct platform_device *pdev) 389 + static int nxp_stm_timer_probe(struct platform_device *pdev) 390 390 { 391 391 struct stm_timer *stm_timer; 392 392 struct device *dev = &pdev->dev; ··· 482 482 }; 483 483 MODULE_DEVICE_TABLE(of, nxp_stm_of_match); 484 484 485 - static struct platform_driver nxp_stm_probe = { 485 + static struct platform_driver nxp_stm_driver = { 486 486 .probe = nxp_stm_timer_probe, 487 487 .driver = { 488 488 .name = "nxp-stm", 489 489 .of_match_table = nxp_stm_of_match, 490 490 }, 491 491 }; 492 - module_platform_driver(nxp_stm_probe); 492 + module_platform_driver(nxp_stm_driver); 493 493 494 494 MODULE_DESCRIPTION("NXP System Timer Module driver"); 495 495 MODULE_LICENSE("GPL");