diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-03-23 18:02:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:39 -0400 |
commit | 109e941843893cb1b4f7bed24c615ba84ce00ff5 (patch) | |
tree | f71dc3d7386f333d23fd990cee12b91f8296ab3d | |
parent | ee6c54ca64416c75aa6f5021e139f270192bae49 (diff) |
rtc: convert rtc spi drivers to module_spi_driver
Factor out some boilerplate code for spi driver registration into
module_spi_driver.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Mark Jackson <mpfj@mimc.co.uk>
Cc: Dennis Aberilla <denzzzhome@yahoo.com>
Cc: Nikolaus Voss <n.voss@weinmann.de>
Cc: "Kim B. Heino" <Kim.Heino@bluegiga.com>
Cc: Raphael Assenat <raph@raphnet.net>
Cc: Chris Verges <chrisv@cyberswitching.com>
Cc: Magnus Damm <damm@opensource.se>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/rtc/rtc-ds1305.c | 12 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds1390.c | 12 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds3234.c | 12 | ||||
-rw-r--r-- | drivers/rtc/rtc-m41t93.c | 12 | ||||
-rw-r--r-- | drivers/rtc/rtc-m41t94.c | 14 | ||||
-rw-r--r-- | drivers/rtc/rtc-max6902.c | 12 | ||||
-rw-r--r-- | drivers/rtc/rtc-pcf2123.c | 13 | ||||
-rw-r--r-- | drivers/rtc/rtc-r9701.c | 12 | ||||
-rw-r--r-- | drivers/rtc/rtc-rs5c348.c | 13 |
9 files changed, 9 insertions, 103 deletions
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 3a33b1fdbe0f..686a865913e1 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c | |||
@@ -814,17 +814,7 @@ static struct spi_driver ds1305_driver = { | |||
814 | /* REVISIT add suspend/resume */ | 814 | /* REVISIT add suspend/resume */ |
815 | }; | 815 | }; |
816 | 816 | ||
817 | static int __init ds1305_init(void) | 817 | module_spi_driver(ds1305_driver); |
818 | { | ||
819 | return spi_register_driver(&ds1305_driver); | ||
820 | } | ||
821 | module_init(ds1305_init); | ||
822 | |||
823 | static void __exit ds1305_exit(void) | ||
824 | { | ||
825 | spi_unregister_driver(&ds1305_driver); | ||
826 | } | ||
827 | module_exit(ds1305_exit); | ||
828 | 818 | ||
829 | MODULE_DESCRIPTION("RTC driver for DS1305 and DS1306 chips"); | 819 | MODULE_DESCRIPTION("RTC driver for DS1305 and DS1306 chips"); |
830 | MODULE_LICENSE("GPL"); | 820 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/rtc/rtc-ds1390.c b/drivers/rtc/rtc-ds1390.c index b038d2cfef26..b0a99e1b25be 100644 --- a/drivers/rtc/rtc-ds1390.c +++ b/drivers/rtc/rtc-ds1390.c | |||
@@ -175,17 +175,7 @@ static struct spi_driver ds1390_driver = { | |||
175 | .remove = __devexit_p(ds1390_remove), | 175 | .remove = __devexit_p(ds1390_remove), |
176 | }; | 176 | }; |
177 | 177 | ||
178 | static __init int ds1390_init(void) | 178 | module_spi_driver(ds1390_driver); |
179 | { | ||
180 | return spi_register_driver(&ds1390_driver); | ||
181 | } | ||
182 | module_init(ds1390_init); | ||
183 | |||
184 | static __exit void ds1390_exit(void) | ||
185 | { | ||
186 | spi_unregister_driver(&ds1390_driver); | ||
187 | } | ||
188 | module_exit(ds1390_exit); | ||
189 | 179 | ||
190 | MODULE_DESCRIPTION("Dallas/Maxim DS1390/93/94 SPI RTC driver"); | 180 | MODULE_DESCRIPTION("Dallas/Maxim DS1390/93/94 SPI RTC driver"); |
191 | MODULE_AUTHOR("Mark Jackson <mpfj@mimc.co.uk>"); | 181 | MODULE_AUTHOR("Mark Jackson <mpfj@mimc.co.uk>"); |
diff --git a/drivers/rtc/rtc-ds3234.c b/drivers/rtc/rtc-ds3234.c index bbd26228f532..fda707926f02 100644 --- a/drivers/rtc/rtc-ds3234.c +++ b/drivers/rtc/rtc-ds3234.c | |||
@@ -173,17 +173,7 @@ static struct spi_driver ds3234_driver = { | |||
173 | .remove = __devexit_p(ds3234_remove), | 173 | .remove = __devexit_p(ds3234_remove), |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static __init int ds3234_init(void) | 176 | module_spi_driver(ds3234_driver); |
177 | { | ||
178 | return spi_register_driver(&ds3234_driver); | ||
179 | } | ||
180 | module_init(ds3234_init); | ||
181 | |||
182 | static __exit void ds3234_exit(void) | ||
183 | { | ||
184 | spi_unregister_driver(&ds3234_driver); | ||
185 | } | ||
186 | module_exit(ds3234_exit); | ||
187 | 177 | ||
188 | MODULE_DESCRIPTION("DS3234 SPI RTC driver"); | 178 | MODULE_DESCRIPTION("DS3234 SPI RTC driver"); |
189 | MODULE_AUTHOR("Dennis Aberilla <denzzzhome@yahoo.com>"); | 179 | MODULE_AUTHOR("Dennis Aberilla <denzzzhome@yahoo.com>"); |
diff --git a/drivers/rtc/rtc-m41t93.c b/drivers/rtc/rtc-m41t93.c index ef71132ff205..10f1c29436ec 100644 --- a/drivers/rtc/rtc-m41t93.c +++ b/drivers/rtc/rtc-m41t93.c | |||
@@ -206,17 +206,7 @@ static struct spi_driver m41t93_driver = { | |||
206 | .remove = __devexit_p(m41t93_remove), | 206 | .remove = __devexit_p(m41t93_remove), |
207 | }; | 207 | }; |
208 | 208 | ||
209 | static __init int m41t93_init(void) | 209 | module_spi_driver(m41t93_driver); |
210 | { | ||
211 | return spi_register_driver(&m41t93_driver); | ||
212 | } | ||
213 | module_init(m41t93_init); | ||
214 | |||
215 | static __exit void m41t93_exit(void) | ||
216 | { | ||
217 | spi_unregister_driver(&m41t93_driver); | ||
218 | } | ||
219 | module_exit(m41t93_exit); | ||
220 | 210 | ||
221 | MODULE_AUTHOR("Nikolaus Voss <n.voss@weinmann.de>"); | 211 | MODULE_AUTHOR("Nikolaus Voss <n.voss@weinmann.de>"); |
222 | MODULE_DESCRIPTION("Driver for ST M41T93 SPI RTC"); | 212 | MODULE_DESCRIPTION("Driver for ST M41T93 SPI RTC"); |
diff --git a/drivers/rtc/rtc-m41t94.c b/drivers/rtc/rtc-m41t94.c index 2a4721f61797..6e78193e026b 100644 --- a/drivers/rtc/rtc-m41t94.c +++ b/drivers/rtc/rtc-m41t94.c | |||
@@ -153,19 +153,7 @@ static struct spi_driver m41t94_driver = { | |||
153 | .remove = __devexit_p(m41t94_remove), | 153 | .remove = __devexit_p(m41t94_remove), |
154 | }; | 154 | }; |
155 | 155 | ||
156 | static __init int m41t94_init(void) | 156 | module_spi_driver(m41t94_driver); |
157 | { | ||
158 | return spi_register_driver(&m41t94_driver); | ||
159 | } | ||
160 | |||
161 | module_init(m41t94_init); | ||
162 | |||
163 | static __exit void m41t94_exit(void) | ||
164 | { | ||
165 | spi_unregister_driver(&m41t94_driver); | ||
166 | } | ||
167 | |||
168 | module_exit(m41t94_exit); | ||
169 | 157 | ||
170 | MODULE_AUTHOR("Kim B. Heino <Kim.Heino@bluegiga.com>"); | 158 | MODULE_AUTHOR("Kim B. Heino <Kim.Heino@bluegiga.com>"); |
171 | MODULE_DESCRIPTION("Driver for ST M41T94 SPI RTC"); | 159 | MODULE_DESCRIPTION("Driver for ST M41T94 SPI RTC"); |
diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c index 1f6b3cc58e8a..36c74d22e8b5 100644 --- a/drivers/rtc/rtc-max6902.c +++ b/drivers/rtc/rtc-max6902.c | |||
@@ -160,17 +160,7 @@ static struct spi_driver max6902_driver = { | |||
160 | .remove = __devexit_p(max6902_remove), | 160 | .remove = __devexit_p(max6902_remove), |
161 | }; | 161 | }; |
162 | 162 | ||
163 | static __init int max6902_init(void) | 163 | module_spi_driver(max6902_driver); |
164 | { | ||
165 | return spi_register_driver(&max6902_driver); | ||
166 | } | ||
167 | module_init(max6902_init); | ||
168 | |||
169 | static __exit void max6902_exit(void) | ||
170 | { | ||
171 | spi_unregister_driver(&max6902_driver); | ||
172 | } | ||
173 | module_exit(max6902_exit); | ||
174 | 164 | ||
175 | MODULE_DESCRIPTION ("max6902 spi RTC driver"); | 165 | MODULE_DESCRIPTION ("max6902 spi RTC driver"); |
176 | MODULE_AUTHOR ("Raphael Assenat"); | 166 | MODULE_AUTHOR ("Raphael Assenat"); |
diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c index b46c4004d8fe..836118795c0b 100644 --- a/drivers/rtc/rtc-pcf2123.c +++ b/drivers/rtc/rtc-pcf2123.c | |||
@@ -346,20 +346,9 @@ static struct spi_driver pcf2123_driver = { | |||
346 | .remove = __devexit_p(pcf2123_remove), | 346 | .remove = __devexit_p(pcf2123_remove), |
347 | }; | 347 | }; |
348 | 348 | ||
349 | static int __init pcf2123_init(void) | 349 | module_spi_driver(pcf2123_driver); |
350 | { | ||
351 | return spi_register_driver(&pcf2123_driver); | ||
352 | } | ||
353 | |||
354 | static void __exit pcf2123_exit(void) | ||
355 | { | ||
356 | spi_unregister_driver(&pcf2123_driver); | ||
357 | } | ||
358 | 350 | ||
359 | MODULE_AUTHOR("Chris Verges <chrisv@cyberswitching.com>"); | 351 | MODULE_AUTHOR("Chris Verges <chrisv@cyberswitching.com>"); |
360 | MODULE_DESCRIPTION("NXP PCF2123 RTC driver"); | 352 | MODULE_DESCRIPTION("NXP PCF2123 RTC driver"); |
361 | MODULE_LICENSE("GPL"); | 353 | MODULE_LICENSE("GPL"); |
362 | MODULE_VERSION(DRV_VERSION); | 354 | MODULE_VERSION(DRV_VERSION); |
363 | |||
364 | module_init(pcf2123_init); | ||
365 | module_exit(pcf2123_exit); | ||
diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c index 2853c2a6f10f..7f8e6c247935 100644 --- a/drivers/rtc/rtc-r9701.c +++ b/drivers/rtc/rtc-r9701.c | |||
@@ -159,17 +159,7 @@ static struct spi_driver r9701_driver = { | |||
159 | .remove = __devexit_p(r9701_remove), | 159 | .remove = __devexit_p(r9701_remove), |
160 | }; | 160 | }; |
161 | 161 | ||
162 | static __init int r9701_init(void) | 162 | module_spi_driver(r9701_driver); |
163 | { | ||
164 | return spi_register_driver(&r9701_driver); | ||
165 | } | ||
166 | module_init(r9701_init); | ||
167 | |||
168 | static __exit void r9701_exit(void) | ||
169 | { | ||
170 | spi_unregister_driver(&r9701_driver); | ||
171 | } | ||
172 | module_exit(r9701_exit); | ||
173 | 163 | ||
174 | MODULE_DESCRIPTION("r9701 spi RTC driver"); | 164 | MODULE_DESCRIPTION("r9701 spi RTC driver"); |
175 | MODULE_AUTHOR("Magnus Damm <damm@opensource.se>"); | 165 | MODULE_AUTHOR("Magnus Damm <damm@opensource.se>"); |
diff --git a/drivers/rtc/rtc-rs5c348.c b/drivers/rtc/rtc-rs5c348.c index ce2ca8523ddd..77074ccd2850 100644 --- a/drivers/rtc/rtc-rs5c348.c +++ b/drivers/rtc/rtc-rs5c348.c | |||
@@ -235,18 +235,7 @@ static struct spi_driver rs5c348_driver = { | |||
235 | .remove = __devexit_p(rs5c348_remove), | 235 | .remove = __devexit_p(rs5c348_remove), |
236 | }; | 236 | }; |
237 | 237 | ||
238 | static __init int rs5c348_init(void) | 238 | module_spi_driver(rs5c348_driver); |
239 | { | ||
240 | return spi_register_driver(&rs5c348_driver); | ||
241 | } | ||
242 | |||
243 | static __exit void rs5c348_exit(void) | ||
244 | { | ||
245 | spi_unregister_driver(&rs5c348_driver); | ||
246 | } | ||
247 | |||
248 | module_init(rs5c348_init); | ||
249 | module_exit(rs5c348_exit); | ||
250 | 239 | ||
251 | MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>"); | 240 | MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>"); |
252 | MODULE_DESCRIPTION("Ricoh RS5C348 RTC driver"); | 241 | MODULE_DESCRIPTION("Ricoh RS5C348 RTC driver"); |