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/sun5i: 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>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20250602151853.1942521-4-daniel.lezcano@linaro.org

+2
+2
drivers/clocksource/timer-sun5i.c
··· 185 185 cs->clksrc.read = sun5i_clksrc_read; 186 186 cs->clksrc.mask = CLOCKSOURCE_MASK(32); 187 187 cs->clksrc.flags = CLOCK_SOURCE_IS_CONTINUOUS; 188 + cs->clksrc.owner = THIS_MODULE; 188 189 189 190 ret = clocksource_register_hz(&cs->clksrc, rate); 190 191 if (ret) { ··· 215 214 ce->clkevt.rating = 340; 216 215 ce->clkevt.irq = irq; 217 216 ce->clkevt.cpumask = cpu_possible_mask; 217 + ce->clkevt.owner = THIS_MODULE; 218 218 219 219 /* Enable timer0 interrupt */ 220 220 val = readl(base + TIMER_IRQ_EN_REG);