[PATCH] clocksource/drivers/nxp-timer: Don't call platform driver struct nxp_stm_probe

Uwe Kleine-König u.kleine-koenig at baylibre.com
Tue Jul 1 08:39:56 PDT 2025


There are a few rules in the modpost step checking for section
mismatches that depend on an object's name. The checks for objects with
a name ending in (e.g.) _probe are more lax than they should be for
platform drivers.

So rename the driver struct to end in "_driver" which is the common
thing to do.

Note that this results indeed in a section mismatch, i.e.:

	WARNING: modpost: vmlinux: section mismatch in reference: nxp_stm_driver+0x0 (section: .data) -> nxp_stm_timer_probe (section: .init.text)

that should be fixed. If the relevant device is already available with
all dependencies probed when the driver is registered, the right
approach to do that is using module_platform_driver_probe() instead of
module_platform_driver(). Otherwise it's more complicated.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at baylibre.com>
---
 drivers/clocksource/timer-nxp-stm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/timer-nxp-stm.c b/drivers/clocksource/timer-nxp-stm.c
index d7ccf9001729..1a70c9013921 100644
--- a/drivers/clocksource/timer-nxp-stm.c
+++ b/drivers/clocksource/timer-nxp-stm.c
@@ -482,14 +482,14 @@ static const struct of_device_id nxp_stm_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, nxp_stm_of_match);
 
-static struct platform_driver nxp_stm_probe = {
+static struct platform_driver nxp_stm_driver = {
 	.probe	= nxp_stm_timer_probe,
 	.driver	= {
 		.name		= "nxp-stm",
 		.of_match_table	= nxp_stm_of_match,
 	},
 };
-module_platform_driver(nxp_stm_probe);
+module_platform_driver(nxp_stm_driver);
 
 MODULE_DESCRIPTION("NXP System Timer Module driver");
 MODULE_LICENSE("GPL");

base-commit: 1343433ed38923a21425c602e92120a1f1db5f7a
-- 
2.49.0




More information about the linux-arm-kernel mailing list