]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clocksource/drivers/scx200: Add module owner
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 2 Jun 2025 15:18:45 +0000 (17:18 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 23 Sep 2025 08:21:24 +0000 (10:21 +0200)
The conversion to modules requires a correct handling of the module
refcount in order to prevent to unload it if it is in use. That is
especially true with the clockevents where there is no function to
unregister them.

The core time framework correctly handles the module refcount with the
different clocksource and clockevents if the module owner is set.

Add the module owner to make sure the core framework will prevent
stupid things happening when the driver will be converted into a
module.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Will McVicker <willmcvicker@google.com>
Link: https://lore.kernel.org/r/20250602151853.1942521-2-daniel.lezcano@linaro.org
drivers/clocksource/scx200_hrt.c

index c3536fffbe9a0fa545ae63043ead15ba04333ae6..5a99801a16571739ce4d023dba974064d23fc857 100644 (file)
@@ -52,6 +52,7 @@ static struct clocksource cs_hrt = {
        .mask           = CLOCKSOURCE_MASK(32),
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
        /* mult, shift are set based on mhz27 flag */
+       .owner          = THIS_MODULE,
 };
 
 static int __init init_hrt_clocksource(void)