aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/char/hw_random/nomadik-rng.c13
-rw-r--r--drivers/dma/pl330.c13
-rw-r--r--drivers/input/serio/ambakmi.c13
-rw-r--r--drivers/mmc/host/mmci.c12
-rw-r--r--drivers/rtc/rtc-pl030.c13
-rw-r--r--drivers/rtc/rtc-pl031.c13
-rw-r--r--drivers/watchdog/sp805_wdt.c12
7 files changed, 7 insertions, 82 deletions
diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c
index 3d3c1e6703b4..96de0249e595 100644
--- a/drivers/char/hw_random/nomadik-rng.c
+++ b/drivers/char/hw_random/nomadik-rng.c
@@ -107,17 +107,6 @@ static struct amba_driver nmk_rng_driver = {
107 .id_table = nmk_rng_ids, 107 .id_table = nmk_rng_ids,
108}; 108};
109 109
110static int __init nmk_rng_init(void) 110module_amba_driver(nmk_rng_driver);
111{
112 return amba_driver_register(&nmk_rng_driver);
113}
114
115static void __devexit nmk_rng_exit(void)
116{
117 amba_driver_unregister(&nmk_rng_driver);
118}
119
120module_init(nmk_rng_init);
121module_exit(nmk_rng_exit);
122 111
123MODULE_LICENSE("GPL"); 112MODULE_LICENSE("GPL");
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index b8ec03ee8e22..16b66c827f19 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -1035,18 +1035,7 @@ static struct amba_driver pl330_driver = {
1035 .remove = pl330_remove, 1035 .remove = pl330_remove,
1036}; 1036};
1037 1037
1038static int __init pl330_init(void) 1038module_amba_driver(pl330_driver);
1039{
1040 return amba_driver_register(&pl330_driver);
1041}
1042module_init(pl330_init);
1043
1044static void __exit pl330_exit(void)
1045{
1046 amba_driver_unregister(&pl330_driver);
1047 return;
1048}
1049module_exit(pl330_exit);
1050 1039
1051MODULE_AUTHOR("Jaswinder Singh <jassi.brar@samsung.com>"); 1040MODULE_AUTHOR("Jaswinder Singh <jassi.brar@samsung.com>");
1052MODULE_DESCRIPTION("API Driver for PL330 DMAC"); 1041MODULE_DESCRIPTION("API Driver for PL330 DMAC");
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 8407d5b0ced8..2ffd110bd5bc 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -208,18 +208,7 @@ static struct amba_driver ambakmi_driver = {
208 .resume = amba_kmi_resume, 208 .resume = amba_kmi_resume,
209}; 209};
210 210
211static int __init amba_kmi_init(void) 211module_amba_driver(ambakmi_driver);
212{
213 return amba_driver_register(&ambakmi_driver);
214}
215
216static void __exit amba_kmi_exit(void)
217{
218 amba_driver_unregister(&ambakmi_driver);
219}
220
221module_init(amba_kmi_init);
222module_exit(amba_kmi_exit);
223 212
224MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); 213MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
225MODULE_DESCRIPTION("AMBA KMI controller driver"); 214MODULE_DESCRIPTION("AMBA KMI controller driver");
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 304f2f98b680..6692392c05dd 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1519,18 +1519,8 @@ static struct amba_driver mmci_driver = {
1519 .id_table = mmci_ids, 1519 .id_table = mmci_ids,
1520}; 1520};
1521 1521
1522static int __init mmci_init(void) 1522module_amba_driver(mmci_driver);
1523{
1524 return amba_driver_register(&mmci_driver);
1525}
1526
1527static void __exit mmci_exit(void)
1528{
1529 amba_driver_unregister(&mmci_driver);
1530}
1531 1523
1532module_init(mmci_init);
1533module_exit(mmci_exit);
1534module_param(fmax, uint, 0444); 1524module_param(fmax, uint, 0444);
1535 1525
1536MODULE_DESCRIPTION("ARM PrimeCell PL180/181 Multimedia Card Interface driver"); 1526MODULE_DESCRIPTION("ARM PrimeCell PL180/181 Multimedia Card Interface driver");
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");
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index eef1524ae52e..3ff9e47bd218 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -370,17 +370,7 @@ static struct amba_driver sp805_wdt_driver = {
370 .remove = __devexit_p(sp805_wdt_remove), 370 .remove = __devexit_p(sp805_wdt_remove),
371}; 371};
372 372
373static int __init sp805_wdt_init(void) 373module_amba_driver(sp805_wdt_driver);
374{
375 return amba_driver_register(&sp805_wdt_driver);
376}
377module_init(sp805_wdt_init);
378
379static void __exit sp805_wdt_exit(void)
380{
381 amba_driver_unregister(&sp805_wdt_driver);
382}
383module_exit(sp805_wdt_exit);
384 374
385module_param(nowayout, int, 0); 375module_param(nowayout, int, 0);
386MODULE_PARM_DESC(nowayout, 376MODULE_PARM_DESC(nowayout,