Patchwork [v2,2/2] RTC: rtc-twl: Cleanup with module_platform_driver() conversion

login
register
mail settings
Submitter Péter Ujfalusi
Date April 16, 2013, 8:30 a.m.
Message ID <1366101013-21183-2-git-send-email-peter.ujfalusi@ti.com>
Download mbox | patch
Permalink /patch/236861/
State New
Headers show

Comments

Péter Ujfalusi - April 16, 2013, 8:30 a.m.
Use module_platform_driver() to register the platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/rtc/rtc-twl.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
Kevin Hilman - June 5, 2013, 6:05 p.m.
On Tue, Apr 16, 2013 at 1:30 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> Use module_platform_driver() to register the platform driver.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Acked-by: Kevin Hilman <khilman@linaro.org>

Patch

diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index c385e9b..22b2fd6 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -618,17 +618,7 @@  static struct platform_driver twl4030rtc_driver = {
 	},
 };
 
-static int __init twl_rtc_init(void)
-{
-	return platform_driver_register(&twl4030rtc_driver);
-}
-module_init(twl_rtc_init);
-
-static void __exit twl_rtc_exit(void)
-{
-	platform_driver_unregister(&twl4030rtc_driver);
-}
-module_exit(twl_rtc_exit);
+module_platform_driver(twl4030rtc_driver);
 
 MODULE_AUTHOR("Texas Instruments, MontaVista Software");
 MODULE_LICENSE("GPL");