aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorviresh kumar <viresh.kumar@st.com>2012-03-15 05:40:38 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-03-16 19:32:35 -0400
commit9e5ed094c89e55fbf11d2e81d60be98eb12346c0 (patch)
treeb77c63a452580643cdede36c3038d52995e54d8e /drivers/rtc
parenta64ae394eb7de5e39cf462c18edb202196c678fa (diff)
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 = {
185 .id_table = pl030_ids, 185 .id_table = pl030_ids,
186}; 186};
187 187
188static int __init pl030_init(void) 188module_amba_driver(pl030_driver);
189{
190 return amba_driver_register(&pl030_driver);
191}
192
193static void __exit pl030_exit(void)
194{
195 amba_driver_unregister(&pl030_driver);
196}
197
198module_init(pl030_init);
199module_exit(pl030_exit);
200 189
201MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); 190MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
202MODULE_DESCRIPTION("ARM AMBA PL030 RTC Driver"); 191MODULE_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 = {
431 .remove = pl031_remove, 431 .remove = pl031_remove,
432}; 432};
433 433
434static int __init pl031_init(void) 434module_amba_driver(pl031_driver);
435{
436 return amba_driver_register(&pl031_driver);
437}
438
439static void __exit pl031_exit(void)
440{
441 amba_driver_unregister(&pl031_driver);
442}
443
444module_init(pl031_init);
445module_exit(pl031_exit);
446 435
447MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net"); 436MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net");
448MODULE_DESCRIPTION("ARM AMBA PL031 RTC Driver"); 437MODULE_DESCRIPTION("ARM AMBA PL031 RTC Driver");