[PATCH v1 1/7] clocksource/drivers/scx200: Add module owner
William McVicker
willmcvicker at google.com
Tue Jun 3 10:48:44 PDT 2025
On 06/02/2025, Daniel Lezcano wrote:
> 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 at linaro.org>
Reviewed-by: Will McVicker <willmcvicker at google.com>
Thanks,
Will
> ---
> drivers/clocksource/scx200_hrt.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clocksource/scx200_hrt.c b/drivers/clocksource/scx200_hrt.c
> index c3536fffbe9a..5a99801a1657 100644
> --- a/drivers/clocksource/scx200_hrt.c
> +++ b/drivers/clocksource/scx200_hrt.c
> @@ -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)
> --
> 2.43.0
>
More information about the linux-arm-kernel
mailing list