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/tegra186: 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-5-daniel.lezcano@linaro.org

+3
+3
drivers/clocksource/timer-tegra186.c
··· 373 373 tegra->tsc.read = tegra186_timer_tsc_read; 374 374 tegra->tsc.mask = CLOCKSOURCE_MASK(56); 375 375 tegra->tsc.flags = CLOCK_SOURCE_IS_CONTINUOUS; 376 + tegra->tsc.owner = THIS_MODULE; 376 377 377 378 return clocksource_register_hz(&tegra->tsc, 31250000); 378 379 } ··· 393 392 tegra->osc.read = tegra186_timer_osc_read; 394 393 tegra->osc.mask = CLOCKSOURCE_MASK(32); 395 394 tegra->osc.flags = CLOCK_SOURCE_IS_CONTINUOUS; 395 + tegra->osc.owner = THIS_MODULE; 396 396 397 397 return clocksource_register_hz(&tegra->osc, 38400000); 398 398 } ··· 413 411 tegra->usec.read = tegra186_timer_usec_read; 414 412 tegra->usec.mask = CLOCKSOURCE_MASK(32); 415 413 tegra->usec.flags = CLOCK_SOURCE_IS_CONTINUOUS; 414 + tegra->usec.owner = THIS_MODULE; 416 415 417 416 return clocksource_register_hz(&tegra->usec, USEC_PER_SEC); 418 417 }