Patchwork [3.6.0-] rtc/ds2404: use module_platform_driver macro

login
register
mail settings
Submitter Srinivas KANDAGATLA
Date Oct. 10, 2012, 6:40 p.m.
Message ID <1349894414-10185-1-git-send-email-srinivas.kandagatla@st.com>
Download mbox | patch
Permalink /patch/190744/
State New
Headers show

Comments

Srinivas KANDAGATLA - Oct. 10, 2012, 6:40 p.m.
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>

This patch removes some code duplication by using
module_platform_driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
 drivers/rtc/rtc-ds2404.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

Patch

diff --git a/drivers/rtc/rtc-ds2404.c b/drivers/rtc/rtc-ds2404.c
index 5ea9df7..4539e37 100644
--- a/drivers/rtc/rtc-ds2404.c
+++ b/drivers/rtc/rtc-ds2404.c
@@ -283,19 +283,7 @@  static struct platform_driver rtc_device_driver = {
 		.owner	= THIS_MODULE,
 	},
 };
-
-static __init int ds2404_init(void)
-{
-	return platform_driver_register(&rtc_device_driver);
-}
-
-static __exit void ds2404_exit(void)
-{
-	platform_driver_unregister(&rtc_device_driver);
-}
-
-module_init(ds2404_init);
-module_exit(ds2404_exit);
+module_platform_driver(rtc_device_driver);
 
 MODULE_DESCRIPTION("DS2404 RTC");
 MODULE_AUTHOR("Sven Schnelle");