Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Commit

Permalink
backlight: convert backlight i2c drivers to module_i2c_driver
Browse files Browse the repository at this point in the history
Factor out some boilerplate code for i2c driver registration into
module_i2c_driver.

Signed-off-by: Axel Lin <[email protected]>
Cc: Michael Hennerich <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
AxelLin authored and torvalds committed Mar 23, 2012
1 parent 7d1ae8a commit 81ce686
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
12 changes: 1 addition & 11 deletions drivers/video/backlight/adp8860_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,17 +819,7 @@ static struct i2c_driver adp8860_driver = {
.id_table = adp8860_id,
};

static int __init adp8860_init(void)
{
return i2c_add_driver(&adp8860_driver);
}
module_init(adp8860_init);

static void __exit adp8860_exit(void)
{
i2c_del_driver(&adp8860_driver);
}
module_exit(adp8860_exit);
module_i2c_driver(adp8860_driver);

MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Michael Hennerich <[email protected]>");
Expand Down
12 changes: 1 addition & 11 deletions drivers/video/backlight/adp8870_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,17 +991,7 @@ static struct i2c_driver adp8870_driver = {
.id_table = adp8870_id,
};

static int __init adp8870_init(void)
{
return i2c_add_driver(&adp8870_driver);
}
module_init(adp8870_init);

static void __exit adp8870_exit(void)
{
i2c_del_driver(&adp8870_driver);
}
module_exit(adp8870_exit);
module_i2c_driver(adp8870_driver);

MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Michael Hennerich <[email protected]>");
Expand Down
13 changes: 1 addition & 12 deletions drivers/video/backlight/tosa_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,7 @@ static struct i2c_driver tosa_bl_driver = {
.id_table = tosa_bl_id,
};

static int __init tosa_bl_init(void)
{
return i2c_add_driver(&tosa_bl_driver);
}

static void __exit tosa_bl_exit(void)
{
i2c_del_driver(&tosa_bl_driver);
}

module_init(tosa_bl_init);
module_exit(tosa_bl_exit);
module_i2c_driver(tosa_bl_driver);

MODULE_AUTHOR("Dmitry Baryshkov");
MODULE_LICENSE("GPL v2");
Expand Down

0 comments on commit 81ce686

Please sign in to comment.