diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-01-10 18:09:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 19:30:48 -0500 |
commit | 09a0d183ef3d310ee9d0b835d9db741fda9d6d46 (patch) | |
tree | 8ccf315879a3152eba11961885f5f589088dc9da /drivers | |
parent | 892a8843fbef07a7f2ab62d5f7ff5c16ea0903b0 (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.c | 12 | ||||
-rw-r--r-- | drivers/leds/leds-lm3530.c | 13 | ||||
-rw-r--r-- | drivers/leds/leds-lp3944.c | 13 | ||||
-rw-r--r-- | drivers/leds/leds-lp5521.c | 20 | ||||
-rw-r--r-- | drivers/leds/leds-lp5523.c | 20 | ||||
-rw-r--r-- | drivers/leds/leds-pca9532.c | 14 | ||||
-rw-r--r-- | drivers/leds/leds-pca955x.c | 13 |
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 | ||
816 | static int __init bd2802_init(void) | 816 | module_i2c_driver(bd2802_i2c_driver); |
817 | { | ||
818 | return i2c_add_driver(&bd2802_i2c_driver); | ||
819 | } | ||
820 | module_init(bd2802_init); | ||
821 | |||
822 | static void __exit bd2802_exit(void) | ||
823 | { | ||
824 | i2c_del_driver(&bd2802_i2c_driver); | ||
825 | } | ||
826 | module_exit(bd2802_exit); | ||
827 | 817 | ||
828 | MODULE_AUTHOR("Kim Kyuwon <q1.kim@samsung.com>"); | 818 | MODULE_AUTHOR("Kim Kyuwon <q1.kim@samsung.com>"); |
829 | MODULE_DESCRIPTION("BD2802 LED driver"); | 819 | MODULE_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 | ||
460 | static int __init lm3530_init(void) | 460 | module_i2c_driver(lm3530_i2c_driver); |
461 | { | ||
462 | return i2c_add_driver(&lm3530_i2c_driver); | ||
463 | } | ||
464 | |||
465 | static void __exit lm3530_exit(void) | ||
466 | { | ||
467 | i2c_del_driver(&lm3530_i2c_driver); | ||
468 | } | ||
469 | |||
470 | module_init(lm3530_init); | ||
471 | module_exit(lm3530_exit); | ||
472 | 461 | ||
473 | MODULE_DESCRIPTION("Back Light driver for LM3530"); | 462 | MODULE_DESCRIPTION("Back Light driver for LM3530"); |
474 | MODULE_LICENSE("GPL v2"); | 463 | MODULE_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 | ||
456 | static int __init lp3944_module_init(void) | 456 | module_i2c_driver(lp3944_driver); |
457 | { | ||
458 | return i2c_add_driver(&lp3944_driver); | ||
459 | } | ||
460 | |||
461 | static void __exit lp3944_module_exit(void) | ||
462 | { | ||
463 | i2c_del_driver(&lp3944_driver); | ||
464 | } | ||
465 | |||
466 | module_init(lp3944_module_init); | ||
467 | module_exit(lp3944_module_exit); | ||
468 | 457 | ||
469 | MODULE_AUTHOR("Antonio Ospite <ospite@studenti.unina.it>"); | 458 | MODULE_AUTHOR("Antonio Ospite <ospite@studenti.unina.it>"); |
470 | MODULE_DESCRIPTION("LP3944 Fun Light Chip"); | 459 | MODULE_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 | ||
800 | static int __init lp5521_init(void) | 800 | module_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 | |||
812 | static void __exit lp5521_exit(void) | ||
813 | { | ||
814 | i2c_del_driver(&lp5521_driver); | ||
815 | } | ||
816 | |||
817 | module_init(lp5521_init); | ||
818 | module_exit(lp5521_exit); | ||
819 | 801 | ||
820 | MODULE_AUTHOR("Mathias Nyman, Yuri Zaporozhets, Samu Onkalo"); | 802 | MODULE_AUTHOR("Mathias Nyman, Yuri Zaporozhets, Samu Onkalo"); |
821 | MODULE_DESCRIPTION("LP5521 LED engine"); | 803 | MODULE_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 | ||
1024 | static int __init lp5523_init(void) | 1024 | module_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 | |||
1036 | static void __exit lp5523_exit(void) | ||
1037 | { | ||
1038 | i2c_del_driver(&lp5523_driver); | ||
1039 | } | ||
1040 | |||
1041 | module_init(lp5523_init); | ||
1042 | module_exit(lp5523_exit); | ||
1043 | 1025 | ||
1044 | MODULE_AUTHOR("Mathias Nyman <mathias.nyman@nokia.com>"); | 1026 | MODULE_AUTHOR("Mathias Nyman <mathias.nyman@nokia.com>"); |
1045 | MODULE_DESCRIPTION("LP5523 LED engine"); | 1027 | MODULE_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 | ||
492 | static int __init pca9532_init(void) | 492 | module_i2c_driver(pca9532_driver); |
493 | { | ||
494 | return i2c_add_driver(&pca9532_driver); | ||
495 | } | ||
496 | |||
497 | static void __exit pca9532_exit(void) | ||
498 | { | ||
499 | i2c_del_driver(&pca9532_driver); | ||
500 | } | ||
501 | 493 | ||
502 | MODULE_AUTHOR("Riku Voipio"); | 494 | MODULE_AUTHOR("Riku Voipio"); |
503 | MODULE_LICENSE("GPL"); | 495 | MODULE_LICENSE("GPL"); |
504 | MODULE_DESCRIPTION("PCA 9532 LED dimmer"); | 496 | MODULE_DESCRIPTION("PCA 9532 LED dimmer"); |
505 | |||
506 | module_init(pca9532_init); | ||
507 | module_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 | ||
374 | static int __init pca955x_leds_init(void) | 374 | module_i2c_driver(pca955x_driver); |
375 | { | ||
376 | return i2c_add_driver(&pca955x_driver); | ||
377 | } | ||
378 | |||
379 | static void __exit pca955x_leds_exit(void) | ||
380 | { | ||
381 | i2c_del_driver(&pca955x_driver); | ||
382 | } | ||
383 | |||
384 | module_init(pca955x_leds_init); | ||
385 | module_exit(pca955x_leds_exit); | ||
386 | 375 | ||
387 | MODULE_AUTHOR("Nate Case <ncase@xes-inc.com>"); | 376 | MODULE_AUTHOR("Nate Case <ncase@xes-inc.com>"); |
388 | MODULE_DESCRIPTION("PCA955x LED driver"); | 377 | MODULE_DESCRIPTION("PCA955x LED driver"); |