aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5521.c
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/leds/leds-lp5521.c
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/leds/leds-lp5521.c')
-rw-r--r--drivers/leds/leds-lp5521.c20
1 files changed, 1 insertions, 19 deletions
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");