summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorviresh kumar <viresh.kumar@st.com>2012-03-15 10:40:38 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-03-16 23:32:35 +0000
commit9e5ed094c89e55fbf11d2e81d60be98eb12346c0 (patch)
treeb77c63a452580643cdede36c3038d52995e54d8e /drivers/rtc
parenta64ae394eb7de5e39cf462c18edb202196c678fa (diff)
downloadlinux-stable-9e5ed094c89e55fbf11d2e81d60be98eb12346c0.tar.gz
linux-stable-9e5ed094c89e55fbf11d2e81d60be98eb12346c0.tar.bz2
linux-stable-9e5ed094c89e55fbf11d2e81d60be98eb12346c0.zip
ARM: 7362/1: AMBA: Add module_amba_driver() helper macro for amba_driver
For simple modules that contain a single amba_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_amba_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-pl030.c13
-rw-r--r--drivers/rtc/rtc-pl031.c13
2 files changed, 2 insertions, 24 deletions
diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
index 02111fee077e..b2d3d20baebc 100644
--- a/drivers/rtc/rtc-pl030.c
+++ b/drivers/rtc/rtc-pl030.c
@@ -185,18 +185,7 @@ static struct amba_driver pl030_driver = {
.id_table = pl030_ids,
};
-static int __init pl030_init(void)
-{
- return amba_driver_register(&pl030_driver);
-}
-
-static void __exit pl030_exit(void)
-{
- amba_driver_unregister(&pl030_driver);
-}
-
-module_init(pl030_init);
-module_exit(pl030_exit);
+module_amba_driver(pl030_driver);
MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
MODULE_DESCRIPTION("ARM AMBA PL030 RTC Driver");
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index a952c8de1dd7..359e2c53c545 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -431,18 +431,7 @@ static struct amba_driver pl031_driver = {
.remove = pl031_remove,
};
-static int __init pl031_init(void)
-{
- return amba_driver_register(&pl031_driver);
-}
-
-static void __exit pl031_exit(void)
-{
- amba_driver_unregister(&pl031_driver);
-}
-
-module_init(pl031_init);
-module_exit(pl031_exit);
+module_amba_driver(pl031_driver);
MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net");
MODULE_DESCRIPTION("ARM AMBA PL031 RTC Driver");