Patchwork rtc: rtc-ds1216: use module_platform_driver_probe()

login
register
mail settings
Submitter Fabio Porcedda
Date March 15, 2013, 10:03 a.m.
Message ID <1363341798-20354-1-git-send-email-fabio.porcedda@gmail.com>
Download mbox | patch
Permalink /patch/227945/
State New
Headers show

Comments

Fabio Porcedda - March 15, 2013, 10:03 a.m.
Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
---
 drivers/rtc/rtc-ds1216.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Patch

diff --git a/drivers/rtc/rtc-ds1216.c b/drivers/rtc/rtc-ds1216.c
index 45cd8c9..5710171 100644
--- a/drivers/rtc/rtc-ds1216.c
+++ b/drivers/rtc/rtc-ds1216.c
@@ -206,21 +206,10 @@  static struct platform_driver ds1216_rtc_platform_driver = {
 	.remove		= __exit_p(ds1216_rtc_remove),
 };
 
-static int __init ds1216_rtc_init(void)
-{
-	return platform_driver_probe(&ds1216_rtc_platform_driver, ds1216_rtc_probe);
-}
-
-static void __exit ds1216_rtc_exit(void)
-{
-	platform_driver_unregister(&ds1216_rtc_platform_driver);
-}
+module_platform_driver_probe(ds1216_rtc_platform_driver, ds1216_rtc_probe);
 
 MODULE_AUTHOR("Thomas Bogendoerfer <tsbogend@alpha.franken.de>");
 MODULE_DESCRIPTION("DS1216 RTC driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
 MODULE_ALIAS("platform:rtc-ds1216");
-
-module_init(ds1216_rtc_init);
-module_exit(ds1216_rtc_exit);