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

Configure Feed

Select the types of activity you want to include in your feed.

clocksource/drivers/stm: Add module owner

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-6-daniel.lezcano@linaro.org

+2
+2
drivers/clocksource/timer-nxp-stm.c
··· 201 201 stm_timer->cs.resume = nxp_stm_clocksource_resume; 202 202 stm_timer->cs.mask = CLOCKSOURCE_MASK(32); 203 203 stm_timer->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS; 204 + stm_timer->cs.owner = THIS_MODULE; 204 205 205 206 ret = clocksource_register_hz(&stm_timer->cs, stm_timer->rate); 206 207 if (ret) ··· 315 314 stm_timer->ced.cpumask = cpumask_of(cpu); 316 315 stm_timer->ced.rating = 460; 317 316 stm_timer->ced.irq = irq; 317 + stm_timer->ced.owner = THIS_MODULE; 318 318 319 319 per_cpu(stm_timers, cpu) = stm_timer; 320 320