lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 26 Aug 2022 09:22:57 +0200
From:   Alexandre Belloni <alexandre.belloni@...tlin.com>
To:     Zhang Jianhua <chris.zjh@...wei.com>
Cc:     a.zummo@...ertech.it, linux-rtc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtc: fsl-ftm-alarm: Use module_init and add module_exit

On 26/08/2022 15:00:17+0800, Zhang Jianhua wrote:
> - Use module_init instead of device_initcall.
> - Add a function for module_exit to unregister driver.
> 

I can see what you are doing but this doesn't explain why. Also, was
this tested on any actual hardware?

> Signed-off-by: Zhang Jianhua <chris.zjh@...wei.com>
> ---
>  drivers/rtc/rtc-fsl-ftm-alarm.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
> index c0df49fb978c..28bdc6c97b64 100644
> --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> @@ -332,7 +332,13 @@ static int __init ftm_alarm_init(void)
>  	return platform_driver_register(&ftm_rtc_driver);
>  }
>  
> -device_initcall(ftm_alarm_init);
> +static void __exit ftm_alarm_exit(void)
> +{
> +	platform_driver_unregister(&ftm_rtc_driver);
> +}
> +
> +module_init(ftm_alarm_init)
> +module_exit(ftm_alarm_exit)
>  
>  MODULE_DESCRIPTION("NXP/Freescale FlexTimer alarm driver");
>  MODULE_AUTHOR("Biwen Li <biwen.li@....com>");
> -- 
> 2.31.0
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ