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>
This commit is contained in:
Axel Lin 2012-01-10 15:09:27 -08:00 committed by Linus Torvalds
parent 892a8843fb
commit 09a0d183ef
7 changed files with 7 additions and 98 deletions

View File

@ -813,17 +813,7 @@ static struct i2c_driver bd2802_i2c_driver = {
.id_table = bd2802_id,
};
static int __init bd2802_init(void)
{
return i2c_add_driver(&bd2802_i2c_driver);
}
module_init(bd2802_init);
static void __exit bd2802_exit(void)
{
i2c_del_driver(&bd2802_i2c_driver);
}
module_exit(bd2802_exit);
module_i2c_driver(bd2802_i2c_driver);
MODULE_AUTHOR("Kim Kyuwon <q1.kim@samsung.com>");
MODULE_DESCRIPTION("BD2802 LED driver");

View File

@ -457,18 +457,7 @@ static struct i2c_driver lm3530_i2c_driver = {
},
};
static int __init lm3530_init(void)
{
return i2c_add_driver(&lm3530_i2c_driver);
}
static void __exit lm3530_exit(void)
{
i2c_del_driver(&lm3530_i2c_driver);
}
module_init(lm3530_init);
module_exit(lm3530_exit);
module_i2c_driver(lm3530_i2c_driver);
MODULE_DESCRIPTION("Back Light driver for LM3530");
MODULE_LICENSE("GPL v2");

View File

@ -453,18 +453,7 @@ static struct i2c_driver lp3944_driver = {
.id_table = lp3944_id,
};
static int __init lp3944_module_init(void)
{
return i2c_add_driver(&lp3944_driver);
}
static void __exit lp3944_module_exit(void)
{
i2c_del_driver(&lp3944_driver);
}
module_init(lp3944_module_init);
module_exit(lp3944_module_exit);
module_i2c_driver(lp3944_driver);
MODULE_AUTHOR("Antonio Ospite <ospite@studenti.unina.it>");
MODULE_DESCRIPTION("LP3944 Fun Light Chip");

View File

@ -797,25 +797,7 @@ static struct i2c_driver lp5521_driver = {
.id_table = lp5521_id,
};
static int __init lp5521_init(void)
{
int ret;
ret = i2c_add_driver(&lp5521_driver);
if (ret < 0)
printk(KERN_ALERT "Adding lp5521 driver failed\n");
return ret;
}
static void __exit lp5521_exit(void)
{
i2c_del_driver(&lp5521_driver);
}
module_init(lp5521_init);
module_exit(lp5521_exit);
module_i2c_driver(lp5521_driver);
MODULE_AUTHOR("Mathias Nyman, Yuri Zaporozhets, Samu Onkalo");
MODULE_DESCRIPTION("LP5521 LED engine");

View File

@ -1021,25 +1021,7 @@ static struct i2c_driver lp5523_driver = {
.id_table = lp5523_id,
};
static int __init lp5523_init(void)
{
int ret;
ret = i2c_add_driver(&lp5523_driver);
if (ret < 0)
printk(KERN_ALERT "Adding lp5523 driver failed\n");
return ret;
}
static void __exit lp5523_exit(void)
{
i2c_del_driver(&lp5523_driver);
}
module_init(lp5523_init);
module_exit(lp5523_exit);
module_i2c_driver(lp5523_driver);
MODULE_AUTHOR("Mathias Nyman <mathias.nyman@nokia.com>");
MODULE_DESCRIPTION("LP5523 LED engine");

View File

@ -489,20 +489,8 @@ static int pca9532_remove(struct i2c_client *client)
return 0;
}
static int __init pca9532_init(void)
{
return i2c_add_driver(&pca9532_driver);
}
static void __exit pca9532_exit(void)
{
i2c_del_driver(&pca9532_driver);
}
module_i2c_driver(pca9532_driver);
MODULE_AUTHOR("Riku Voipio");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("PCA 9532 LED dimmer");
module_init(pca9532_init);
module_exit(pca9532_exit);

View File

@ -371,18 +371,7 @@ static struct i2c_driver pca955x_driver = {
.id_table = pca955x_id,
};
static int __init pca955x_leds_init(void)
{
return i2c_add_driver(&pca955x_driver);
}
static void __exit pca955x_leds_exit(void)
{
i2c_del_driver(&pca955x_driver);
}
module_init(pca955x_leds_init);
module_exit(pca955x_leds_exit);
module_i2c_driver(pca955x_driver);
MODULE_AUTHOR("Nate Case <ncase@xes-inc.com>");
MODULE_DESCRIPTION("PCA955x LED driver");