rtc-puv3: using module_platform_driver()
authorGuan Xuetao <gxt@mprc.pku.edu.cn>
Mon, 26 Dec 2011 09:03:50 +0000 (17:03 +0800)
committerGuan Xuetao <gxt@mprc.pku.edu.cn>
Tue, 10 Jan 2012 02:29:42 +0000 (10:29 +0800)
This patch converts the driver to use the module_platform_driver()
macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
drivers/rtc/rtc-puv3.c

index 540ead3..6490a02 100644 (file)
@@ -337,21 +337,7 @@ static struct platform_driver puv3_rtcdrv = {
        }
 };
 
-static char __initdata banner[] = "PKUnity-v3 RTC, (c) 2009 PKUnity Co.\n";
-
-static int __init puv3_rtc_init(void)
-{
-       printk(banner);
-       return platform_driver_register(&puv3_rtcdrv);
-}
-
-static void __exit puv3_rtc_exit(void)
-{
-       platform_driver_unregister(&puv3_rtcdrv);
-}
-
-module_init(puv3_rtc_init);
-module_exit(puv3_rtc_exit);
+module_platform_driver(puv3_rtcdrv);
 
 MODULE_DESCRIPTION("RTC Driver for the PKUnity v3 chip");
 MODULE_AUTHOR("Hu Dongliang");