aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-mxc.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2012-10-04 20:14:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:05:04 -0400
commitbe8b6d510072461b50958527e7b157f53e5388d7 (patch)
tree0b15ee361e714dbe710237f477449f079501b87e /drivers/rtc/rtc-mxc.c
parent0f3cde536d5015a918c4b3fd55fbe335428096e5 (diff)
rtc: rtc-mxc: convert to module_platform_driver
Converting to module_platform_driver can make the code smaller and cleaner. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-mxc.c')
-rw-r--r--drivers/rtc/rtc-mxc.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 334c43e0ce0e..cd0106293a49 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -343,7 +343,7 @@ static struct rtc_class_ops mxc_rtc_ops = {
343 .alarm_irq_enable = mxc_rtc_alarm_irq_enable, 343 .alarm_irq_enable = mxc_rtc_alarm_irq_enable,
344}; 344};
345 345
346static int __init mxc_rtc_probe(struct platform_device *pdev) 346static int __devinit mxc_rtc_probe(struct platform_device *pdev)
347{ 347{
348 struct resource *res; 348 struct resource *res;
349 struct rtc_device *rtc; 349 struct rtc_device *rtc;
@@ -433,7 +433,7 @@ exit_free_pdata:
433 return ret; 433 return ret;
434} 434}
435 435
436static int __exit mxc_rtc_remove(struct platform_device *pdev) 436static int __devexit mxc_rtc_remove(struct platform_device *pdev)
437{ 437{
438 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 438 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
439 439
@@ -480,21 +480,11 @@ static struct platform_driver mxc_rtc_driver = {
480#endif 480#endif
481 .owner = THIS_MODULE, 481 .owner = THIS_MODULE,
482 }, 482 },
483 .remove = __exit_p(mxc_rtc_remove), 483 .probe = mxc_rtc_probe,
484 .remove = __devexit_p(mxc_rtc_remove),
484}; 485};
485 486
486static int __init mxc_rtc_init(void) 487module_platform_driver(mxc_rtc_driver)
487{
488 return platform_driver_probe(&mxc_rtc_driver, mxc_rtc_probe);
489}
490
491static void __exit mxc_rtc_exit(void)
492{
493 platform_driver_unregister(&mxc_rtc_driver);
494}
495
496module_init(mxc_rtc_init);
497module_exit(mxc_rtc_exit);
498 488
499MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 489MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
500MODULE_DESCRIPTION("RTC driver for Freescale MXC"); 490MODULE_DESCRIPTION("RTC driver for Freescale MXC");