aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-07 11:24:00 -0500
committerGrant Likely <grant.likely@secretlab.ca>2012-01-02 02:26:06 -0500
commit6f61415e9c4c0ab02c8eda7671bb652db4863cc0 (patch)
tree689e7f50b2d6de5a5a36d72b2ba72a742d39341c /drivers/gpio
parentf134759955bbb5bf28a8d2c6fe5aa201d1ffb860 (diff)
gpio: Convert GPIO drivers to module_platform_driver
Where appropriate factor out some boilerplate code for platform device registration into module_platform_driver. Drivers that don't use the standard module_init initcall haven't been converted. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-adp5520.c12
-rw-r--r--drivers/gpio/gpio-cs5535.c13
-rw-r--r--drivers/gpio/gpio-da9052.c12
-rw-r--r--drivers/gpio/gpio-generic.c12
-rw-r--r--drivers/gpio/gpio-janz-ttl.c13
-rw-r--r--drivers/gpio/gpio-rdc321x.c13
-rw-r--r--drivers/gpio/gpio-sch.c13
-rw-r--r--drivers/gpio/gpio-timberdale.c13
-rw-r--r--drivers/gpio/gpio-ucb1400.c13
-rw-r--r--drivers/gpio/gpio-vr41xx.c13
-rw-r--r--drivers/gpio/gpio-vx855.c12
11 files changed, 11 insertions, 128 deletions
diff --git a/drivers/gpio/gpio-adp5520.c b/drivers/gpio/gpio-adp5520.c
index 9f2781537001..2f263cc32561 100644
--- a/drivers/gpio/gpio-adp5520.c
+++ b/drivers/gpio/gpio-adp5520.c
@@ -193,17 +193,7 @@ static struct platform_driver adp5520_gpio_driver = {
193 .remove = __devexit_p(adp5520_gpio_remove), 193 .remove = __devexit_p(adp5520_gpio_remove),
194}; 194};
195 195
196static int __init adp5520_gpio_init(void) 196module_platform_driver(adp5520_gpio_driver);
197{
198 return platform_driver_register(&adp5520_gpio_driver);
199}
200module_init(adp5520_gpio_init);
201
202static void __exit adp5520_gpio_exit(void)
203{
204 platform_driver_unregister(&adp5520_gpio_driver);
205}
206module_exit(adp5520_gpio_exit);
207 197
208MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 198MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
209MODULE_DESCRIPTION("GPIO ADP5520 Driver"); 199MODULE_DESCRIPTION("GPIO ADP5520 Driver");
diff --git a/drivers/gpio/gpio-cs5535.c b/drivers/gpio/gpio-cs5535.c
index 693a81beb3c7..19eda1bbe343 100644
--- a/drivers/gpio/gpio-cs5535.c
+++ b/drivers/gpio/gpio-cs5535.c
@@ -381,18 +381,7 @@ static struct platform_driver cs5535_gpio_driver = {
381 .remove = __devexit_p(cs5535_gpio_remove), 381 .remove = __devexit_p(cs5535_gpio_remove),
382}; 382};
383 383
384static int __init cs5535_gpio_init(void) 384module_platform_driver(cs5535_gpio_driver);
385{
386 return platform_driver_register(&cs5535_gpio_driver);
387}
388
389static void __exit cs5535_gpio_exit(void)
390{
391 platform_driver_unregister(&cs5535_gpio_driver);
392}
393
394module_init(cs5535_gpio_init);
395module_exit(cs5535_gpio_exit);
396 385
397MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>"); 386MODULE_AUTHOR("Andres Salomon <dilinger@queued.net>");
398MODULE_DESCRIPTION("AMD CS5535/CS5536 GPIO driver"); 387MODULE_DESCRIPTION("AMD CS5535/CS5536 GPIO driver");
diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c
index 038f5eb8b13d..58ac3777f0c4 100644
--- a/drivers/gpio/gpio-da9052.c
+++ b/drivers/gpio/gpio-da9052.c
@@ -259,17 +259,7 @@ static struct platform_driver da9052_gpio_driver = {
259 }, 259 },
260}; 260};
261 261
262static int __init da9052_gpio_init(void) 262module_platform_driver(da9052_gpio_driver);
263{
264 return platform_driver_register(&da9052_gpio_driver);
265}
266module_init(da9052_gpio_init);
267
268static void __exit da9052_gpio_exit(void)
269{
270 return platform_driver_unregister(&da9052_gpio_driver);
271}
272module_exit(da9052_gpio_exit);
273 263
274MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>"); 264MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
275MODULE_DESCRIPTION("DA9052 GPIO Device Driver"); 265MODULE_DESCRIPTION("DA9052 GPIO Device Driver");
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
index 4e24436b0f82..e38dd0c31973 100644
--- a/drivers/gpio/gpio-generic.c
+++ b/drivers/gpio/gpio-generic.c
@@ -524,17 +524,7 @@ static struct platform_driver bgpio_driver = {
524 .remove = __devexit_p(bgpio_pdev_remove), 524 .remove = __devexit_p(bgpio_pdev_remove),
525}; 525};
526 526
527static int __init bgpio_platform_init(void) 527module_platform_driver(bgpio_driver);
528{
529 return platform_driver_register(&bgpio_driver);
530}
531module_init(bgpio_platform_init);
532
533static void __exit bgpio_platform_exit(void)
534{
535 platform_driver_unregister(&bgpio_driver);
536}
537module_exit(bgpio_platform_exit);
538 528
539#endif /* CONFIG_GPIO_GENERIC_PLATFORM */ 529#endif /* CONFIG_GPIO_GENERIC_PLATFORM */
540 530
diff --git a/drivers/gpio/gpio-janz-ttl.c b/drivers/gpio/gpio-janz-ttl.c
index 6f7fda0b61ab..f2f000dd70b3 100644
--- a/drivers/gpio/gpio-janz-ttl.c
+++ b/drivers/gpio/gpio-janz-ttl.c
@@ -237,20 +237,9 @@ static struct platform_driver ttl_driver = {
237 .remove = __devexit_p(ttl_remove), 237 .remove = __devexit_p(ttl_remove),
238}; 238};
239 239
240static int __init ttl_init(void) 240module_platform_driver(ttl_driver);
241{
242 return platform_driver_register(&ttl_driver);
243}
244
245static void __exit ttl_exit(void)
246{
247 platform_driver_unregister(&ttl_driver);
248}
249 241
250MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>"); 242MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>");
251MODULE_DESCRIPTION("Janz MODULbus VMOD-TTL Driver"); 243MODULE_DESCRIPTION("Janz MODULbus VMOD-TTL Driver");
252MODULE_LICENSE("GPL"); 244MODULE_LICENSE("GPL");
253MODULE_ALIAS("platform:janz-ttl"); 245MODULE_ALIAS("platform:janz-ttl");
254
255module_init(ttl_init);
256module_exit(ttl_exit);
diff --git a/drivers/gpio/gpio-rdc321x.c b/drivers/gpio/gpio-rdc321x.c
index 2762698e0204..e97016af6443 100644
--- a/drivers/gpio/gpio-rdc321x.c
+++ b/drivers/gpio/gpio-rdc321x.c
@@ -227,18 +227,7 @@ static struct platform_driver rdc321x_gpio_driver = {
227 .remove = __devexit_p(rdc321x_gpio_remove), 227 .remove = __devexit_p(rdc321x_gpio_remove),
228}; 228};
229 229
230static int __init rdc321x_gpio_init(void) 230module_platform_driver(rdc321x_gpio_driver);
231{
232 return platform_driver_register(&rdc321x_gpio_driver);
233}
234
235static void __exit rdc321x_gpio_exit(void)
236{
237 platform_driver_unregister(&rdc321x_gpio_driver);
238}
239
240module_init(rdc321x_gpio_init);
241module_exit(rdc321x_gpio_exit);
242 231
243MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); 232MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
244MODULE_DESCRIPTION("RDC321x GPIO driver"); 233MODULE_DESCRIPTION("RDC321x GPIO driver");
diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
index 163515845494..8cadf4d683a8 100644
--- a/drivers/gpio/gpio-sch.c
+++ b/drivers/gpio/gpio-sch.c
@@ -297,18 +297,7 @@ static struct platform_driver sch_gpio_driver = {
297 .remove = __devexit_p(sch_gpio_remove), 297 .remove = __devexit_p(sch_gpio_remove),
298}; 298};
299 299
300static int __init sch_gpio_init(void) 300module_platform_driver(sch_gpio_driver);
301{
302 return platform_driver_register(&sch_gpio_driver);
303}
304
305static void __exit sch_gpio_exit(void)
306{
307 platform_driver_unregister(&sch_gpio_driver);
308}
309
310module_init(sch_gpio_init);
311module_exit(sch_gpio_exit);
312 301
313MODULE_AUTHOR("Denis Turischev <denis@compulab.co.il>"); 302MODULE_AUTHOR("Denis Turischev <denis@compulab.co.il>");
314MODULE_DESCRIPTION("GPIO interface for Intel Poulsbo SCH"); 303MODULE_DESCRIPTION("GPIO interface for Intel Poulsbo SCH");
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index c593bd46bfb6..031c6adf5b65 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -359,18 +359,7 @@ static struct platform_driver timbgpio_platform_driver = {
359 359
360/*--------------------------------------------------------------------------*/ 360/*--------------------------------------------------------------------------*/
361 361
362static int __init timbgpio_init(void) 362module_platform_driver(timbgpio_platform_driver);
363{
364 return platform_driver_register(&timbgpio_platform_driver);
365}
366
367static void __exit timbgpio_exit(void)
368{
369 platform_driver_unregister(&timbgpio_platform_driver);
370}
371
372module_init(timbgpio_init);
373module_exit(timbgpio_exit);
374 363
375MODULE_DESCRIPTION("Timberdale GPIO driver"); 364MODULE_DESCRIPTION("Timberdale GPIO driver");
376MODULE_LICENSE("GPL v2"); 365MODULE_LICENSE("GPL v2");
diff --git a/drivers/gpio/gpio-ucb1400.c b/drivers/gpio/gpio-ucb1400.c
index 50e6bd1392ce..26405efe0f9f 100644
--- a/drivers/gpio/gpio-ucb1400.c
+++ b/drivers/gpio/gpio-ucb1400.c
@@ -103,23 +103,12 @@ static struct platform_driver ucb1400_gpio_driver = {
103 }, 103 },
104}; 104};
105 105
106static int __init ucb1400_gpio_init(void)
107{
108 return platform_driver_register(&ucb1400_gpio_driver);
109}
110
111static void __exit ucb1400_gpio_exit(void)
112{
113 platform_driver_unregister(&ucb1400_gpio_driver);
114}
115
116void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) 106void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data)
117{ 107{
118 ucbdata = data; 108 ucbdata = data;
119} 109}
120 110
121module_init(ucb1400_gpio_init); 111module_platform_driver(ucb1400_gpio_driver);
122module_exit(ucb1400_gpio_exit);
123 112
124MODULE_DESCRIPTION("Philips UCB1400 GPIO driver"); 113MODULE_DESCRIPTION("Philips UCB1400 GPIO driver");
125MODULE_LICENSE("GPL"); 114MODULE_LICENSE("GPL");
diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
index 98723cb9ac68..82d5c20ad3cb 100644
--- a/drivers/gpio/gpio-vr41xx.c
+++ b/drivers/gpio/gpio-vr41xx.c
@@ -571,15 +571,4 @@ static struct platform_driver giu_device_driver = {
571 }, 571 },
572}; 572};
573 573
574static int __init vr41xx_giu_init(void) 574module_platform_driver(giu_device_driver);
575{
576 return platform_driver_register(&giu_device_driver);
577}
578
579static void __exit vr41xx_giu_exit(void)
580{
581 platform_driver_unregister(&giu_device_driver);
582}
583
584module_init(vr41xx_giu_init);
585module_exit(vr41xx_giu_exit);
diff --git a/drivers/gpio/gpio-vx855.c b/drivers/gpio/gpio-vx855.c
index ef5aabd8b8b7..76ebfe5ff702 100644
--- a/drivers/gpio/gpio-vx855.c
+++ b/drivers/gpio/gpio-vx855.c
@@ -315,17 +315,7 @@ static struct platform_driver vx855gpio_driver = {
315 .remove = __devexit_p(vx855gpio_remove), 315 .remove = __devexit_p(vx855gpio_remove),
316}; 316};
317 317
318static int vx855gpio_init(void) 318module_platform_driver(vx855gpio_driver);
319{
320 return platform_driver_register(&vx855gpio_driver);
321}
322module_init(vx855gpio_init);
323
324static void vx855gpio_exit(void)
325{
326 platform_driver_unregister(&vx855gpio_driver);
327}
328module_exit(vx855gpio_exit);
329 319
330MODULE_LICENSE("GPL"); 320MODULE_LICENSE("GPL");
331MODULE_AUTHOR("Harald Welte <HaraldWelte@viatech.com>"); 321MODULE_AUTHOR("Harald Welte <HaraldWelte@viatech.com>");