aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-01-10 18:09:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 19:30:48 -0500
commit09a0d183ef3d310ee9d0b835d9db741fda9d6d46 (patch)
tree8ccf315879a3152eba11961885f5f589088dc9da /drivers
parent892a8843fbef07a7f2ab62d5f7ff5c16ea0903b0 (diff)
leds: convert led i2c drivers to module_i2c_driver
Factor out some boilerplate code for i2c driver registration into module_i2c_driver. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Haojian Zhuang <hzhuang1@marvell.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Cc: Mike Rapoport <mike@compulab.co.il> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/leds/leds-bd2802.c12
-rw-r--r--drivers/leds/leds-lm3530.c13
-rw-r--r--drivers/leds/leds-lp3944.c13
-rw-r--r--drivers/leds/leds-lp5521.c20
-rw-r--r--drivers/leds/leds-lp5523.c20
-rw-r--r--drivers/leds/leds-pca9532.c14
-rw-r--r--drivers/leds/leds-pca955x.c13
7 files changed, 7 insertions, 98 deletions
diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c
index ea2185531f82..10e40971ffbb 100644
--- a/drivers/leds/leds-bd2802.c
+++ b/drivers/leds/leds-bd2802.c
@@ -813,17 +813,7 @@ static struct i2c_driver bd2802_i2c_driver = {
813 .id_table = bd2802_id, 813 .id_table = bd2802_id,
814}; 814};
815 815
816static int __init bd2802_init(void) 816module_i2c_driver(bd2802_i2c_driver);
817{
818 return i2c_add_driver(&bd2802_i2c_driver);
819}
820module_init(bd2802_init);
821
822static void __exit bd2802_exit(void)
823{
824 i2c_del_driver(&bd2802_i2c_driver);
825}
826module_exit(bd2802_exit);
827 817
828MODULE_AUTHOR("Kim Kyuwon <q1.kim@samsung.com>"); 818MODULE_AUTHOR("Kim Kyuwon <q1.kim@samsung.com>");
829MODULE_DESCRIPTION("BD2802 LED driver"); 819MODULE_DESCRIPTION("BD2802 LED driver");
diff --git a/drivers/leds/leds-lm3530.c b/drivers/leds/leds-lm3530.c
index 0630e4f4b286..45e6878d7374 100644
--- a/drivers/leds/leds-lm3530.c
+++ b/drivers/leds/leds-lm3530.c
@@ -457,18 +457,7 @@ static struct i2c_driver lm3530_i2c_driver = {
457 }, 457 },
458}; 458};
459 459
460static int __init lm3530_init(void) 460module_i2c_driver(lm3530_i2c_driver);
461{
462 return i2c_add_driver(&lm3530_i2c_driver);
463}
464
465static void __exit lm3530_exit(void)
466{
467 i2c_del_driver(&lm3530_i2c_driver);
468}
469
470module_init(lm3530_init);
471module_exit(lm3530_exit);
472 461
473MODULE_DESCRIPTION("Back Light driver for LM3530"); 462MODULE_DESCRIPTION("Back Light driver for LM3530");
474MODULE_LICENSE("GPL v2"); 463MODULE_LICENSE("GPL v2");
diff --git a/drivers/leds/leds-lp3944.c b/drivers/leds/leds-lp3944.c
index 9010c054615e..b8f9f0a5d431 100644
--- a/drivers/leds/leds-lp3944.c
+++ b/drivers/leds/leds-lp3944.c
@@ -453,18 +453,7 @@ static struct i2c_driver lp3944_driver = {
453 .id_table = lp3944_id, 453 .id_table = lp3944_id,
454}; 454};
455 455
456static int __init lp3944_module_init(void) 456module_i2c_driver(lp3944_driver);
457{
458 return i2c_add_driver(&lp3944_driver);
459}
460
461static void __exit lp3944_module_exit(void)
462{
463 i2c_del_driver(&lp3944_driver);
464}
465
466module_init(lp3944_module_init);
467module_exit(lp3944_module_exit);
468 457
469MODULE_AUTHOR("Antonio Ospite <ospite@studenti.unina.it>"); 458MODULE_AUTHOR("Antonio Ospite <ospite@studenti.unina.it>");
470MODULE_DESCRIPTION("LP3944 Fun Light Chip"); 459MODULE_DESCRIPTION("LP3944 Fun Light Chip");
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index cb641f1b3342..d62a7982a5e6 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -797,25 +797,7 @@ static struct i2c_driver lp5521_driver = {
797 .id_table = lp5521_id, 797 .id_table = lp5521_id,
798}; 798};
799 799
800static int __init lp5521_init(void) 800module_i2c_driver(lp5521_driver);
801{
802 int ret;
803
804 ret = i2c_add_driver(&lp5521_driver);
805
806 if (ret < 0)
807 printk(KERN_ALERT "Adding lp5521 driver failed\n");
808
809 return ret;
810}
811
812static void __exit lp5521_exit(void)
813{
814 i2c_del_driver(&lp5521_driver);
815}
816
817module_init(lp5521_init);
818module_exit(lp5521_exit);
819 801
820MODULE_AUTHOR("Mathias Nyman, Yuri Zaporozhets, Samu Onkalo"); 802MODULE_AUTHOR("Mathias Nyman, Yuri Zaporozhets, Samu Onkalo");
821MODULE_DESCRIPTION("LP5521 LED engine"); 803MODULE_DESCRIPTION("LP5521 LED engine");
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 5971e309b234..0170760badbb 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -1021,25 +1021,7 @@ static struct i2c_driver lp5523_driver = {
1021 .id_table = lp5523_id, 1021 .id_table = lp5523_id,
1022}; 1022};
1023 1023
1024static int __init lp5523_init(void) 1024module_i2c_driver(lp5523_driver);
1025{
1026 int ret;
1027
1028 ret = i2c_add_driver(&lp5523_driver);
1029
1030 if (ret < 0)
1031 printk(KERN_ALERT "Adding lp5523 driver failed\n");
1032
1033 return ret;
1034}
1035
1036static void __exit lp5523_exit(void)
1037{
1038 i2c_del_driver(&lp5523_driver);
1039}
1040
1041module_init(lp5523_init);
1042module_exit(lp5523_exit);
1043 1025
1044MODULE_AUTHOR("Mathias Nyman <mathias.nyman@nokia.com>"); 1026MODULE_AUTHOR("Mathias Nyman <mathias.nyman@nokia.com>");
1045MODULE_DESCRIPTION("LP5523 LED engine"); 1027MODULE_DESCRIPTION("LP5523 LED engine");
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index a2c874623e35..ceccab44b5b8 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -489,20 +489,8 @@ static int pca9532_remove(struct i2c_client *client)
489 return 0; 489 return 0;
490} 490}
491 491
492static int __init pca9532_init(void) 492module_i2c_driver(pca9532_driver);
493{
494 return i2c_add_driver(&pca9532_driver);
495}
496
497static void __exit pca9532_exit(void)
498{
499 i2c_del_driver(&pca9532_driver);
500}
501 493
502MODULE_AUTHOR("Riku Voipio"); 494MODULE_AUTHOR("Riku Voipio");
503MODULE_LICENSE("GPL"); 495MODULE_LICENSE("GPL");
504MODULE_DESCRIPTION("PCA 9532 LED dimmer"); 496MODULE_DESCRIPTION("PCA 9532 LED dimmer");
505
506module_init(pca9532_init);
507module_exit(pca9532_exit);
508
diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
index 66aa3e8e786f..dcc3bc3d38db 100644
--- a/drivers/leds/leds-pca955x.c
+++ b/drivers/leds/leds-pca955x.c
@@ -371,18 +371,7 @@ static struct i2c_driver pca955x_driver = {
371 .id_table = pca955x_id, 371 .id_table = pca955x_id,
372}; 372};
373 373
374static int __init pca955x_leds_init(void) 374module_i2c_driver(pca955x_driver);
375{
376 return i2c_add_driver(&pca955x_driver);
377}
378
379static void __exit pca955x_leds_exit(void)
380{
381 i2c_del_driver(&pca955x_driver);
382}
383
384module_init(pca955x_leds_init);
385module_exit(pca955x_leds_exit);
386 375
387MODULE_AUTHOR("Nate Case <ncase@xes-inc.com>"); 376MODULE_AUTHOR("Nate Case <ncase@xes-inc.com>");
388MODULE_DESCRIPTION("PCA955x LED driver"); 377MODULE_DESCRIPTION("PCA955x LED driver");