diff options
author | viresh kumar <viresh.kumar@st.com> | 2012-03-15 05:40:38 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-16 19:32:35 -0400 |
commit | 9e5ed094c89e55fbf11d2e81d60be98eb12346c0 (patch) | |
tree | b77c63a452580643cdede36c3038d52995e54d8e /drivers/rtc | |
parent | a64ae394eb7de5e39cf462c18edb202196c678fa (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.c | 13 | ||||
-rw-r--r-- | drivers/rtc/rtc-pl031.c | 13 |
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 | ||
188 | static int __init pl030_init(void) | 188 | module_amba_driver(pl030_driver); |
189 | { | ||
190 | return amba_driver_register(&pl030_driver); | ||
191 | } | ||
192 | |||
193 | static void __exit pl030_exit(void) | ||
194 | { | ||
195 | amba_driver_unregister(&pl030_driver); | ||
196 | } | ||
197 | |||
198 | module_init(pl030_init); | ||
199 | module_exit(pl030_exit); | ||
200 | 189 | ||
201 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); | 190 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); |
202 | MODULE_DESCRIPTION("ARM AMBA PL030 RTC Driver"); | 191 | 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 = { | |||
431 | .remove = pl031_remove, | 431 | .remove = pl031_remove, |
432 | }; | 432 | }; |
433 | 433 | ||
434 | static int __init pl031_init(void) | 434 | module_amba_driver(pl031_driver); |
435 | { | ||
436 | return amba_driver_register(&pl031_driver); | ||
437 | } | ||
438 | |||
439 | static void __exit pl031_exit(void) | ||
440 | { | ||
441 | amba_driver_unregister(&pl031_driver); | ||
442 | } | ||
443 | |||
444 | module_init(pl031_init); | ||
445 | module_exit(pl031_exit); | ||
446 | 435 | ||
447 | MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net"); | 436 | MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net"); |
448 | MODULE_DESCRIPTION("ARM AMBA PL031 RTC Driver"); | 437 | MODULE_DESCRIPTION("ARM AMBA PL031 RTC Driver"); |