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/leds/leds-lp5523.c | |
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/leds/leds-lp5523.c')
-rw-r--r-- | drivers/leds/leds-lp5523.c | 20 |
1 files changed, 1 insertions, 19 deletions
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"); |