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

rtc: fsl-ftm-alarm: Use module_platform_driver replace device_initcall

The ftm_rtc_driver has been registered while module init, however there
is not unregister step for module exit, now use the macro
module_platform_driver replace device_initcall, which can register and
unregister platform driver automatically.

Signed-off-by: Zhang Jianhua <chris.zjh@huawei.com>
Link: https://lore.kernel.org/r/20220906143037.1455317-1-chris.zjh@huawei.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Zhang Jianhua and committed by
Alexandre Belloni
1ff56edf 97e78b64

+1 -6
+1 -6
drivers/rtc/rtc-fsl-ftm-alarm.c
··· 327 327 }, 328 328 }; 329 329 330 - static int __init ftm_alarm_init(void) 331 - { 332 - return platform_driver_register(&ftm_rtc_driver); 333 - } 334 - 335 - device_initcall(ftm_alarm_init); 330 + module_platform_driver(ftm_rtc_driver); 336 331 337 332 MODULE_DESCRIPTION("NXP/Freescale FlexTimer alarm driver"); 338 333 MODULE_AUTHOR("Biwen Li <biwen.li@nxp.com>");