power_supply: Convert 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: Woogyom Kim <milo.kim@ti.com> Cc: Daniel Jeong <daniel.jeong@ti.com> Cc: Minkyu Kang <mk7.kang@samsung.com> Cc: Peter Edwards <sweetlilmre@gmail.com> Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com> Acked-by: Rhyland Klein <rklein@nvidia.com> Acked-by: Ryan Mallon <rmallon@gmail.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
This commit is contained in:
parent
e2c5f7db78
commit
5ff92e7ab3
6 changed files with 6 additions and 74 deletions
|
@ -403,18 +403,7 @@ static struct i2c_driver ds278x_battery_driver = {
|
|||
.remove = ds278x_battery_remove,
|
||||
.id_table = ds278x_id,
|
||||
};
|
||||
|
||||
static int __init ds278x_init(void)
|
||||
{
|
||||
return i2c_add_driver(&ds278x_battery_driver);
|
||||
}
|
||||
module_init(ds278x_init);
|
||||
|
||||
static void __exit ds278x_exit(void)
|
||||
{
|
||||
i2c_del_driver(&ds278x_battery_driver);
|
||||
}
|
||||
module_exit(ds278x_exit);
|
||||
module_i2c_driver(ds278x_battery_driver);
|
||||
|
||||
MODULE_AUTHOR("Ryan Mallon");
|
||||
MODULE_DESCRIPTION("Maxim/Dallas DS2782 Stand-Alone Fuel Gauage IC driver");
|
||||
|
|
|
@ -490,19 +490,7 @@ static struct i2c_driver lp8727_driver = {
|
|||
.remove = __devexit_p(lp8727_remove),
|
||||
.id_table = lp8727_ids,
|
||||
};
|
||||
|
||||
static int __init lp8727_init(void)
|
||||
{
|
||||
return i2c_add_driver(&lp8727_driver);
|
||||
}
|
||||
|
||||
static void __exit lp8727_exit(void)
|
||||
{
|
||||
i2c_del_driver(&lp8727_driver);
|
||||
}
|
||||
|
||||
module_init(lp8727_init);
|
||||
module_exit(lp8727_exit);
|
||||
module_i2c_driver(lp8727_driver);
|
||||
|
||||
MODULE_DESCRIPTION("TI/National Semiconductor LP8727 charger driver");
|
||||
MODULE_AUTHOR("Woogyom Kim <milo.kim@ti.com>, "
|
||||
|
|
|
@ -290,18 +290,7 @@ static struct i2c_driver max17040_i2c_driver = {
|
|||
.resume = max17040_resume,
|
||||
.id_table = max17040_id,
|
||||
};
|
||||
|
||||
static int __init max17040_init(void)
|
||||
{
|
||||
return i2c_add_driver(&max17040_i2c_driver);
|
||||
}
|
||||
module_init(max17040_init);
|
||||
|
||||
static void __exit max17040_exit(void)
|
||||
{
|
||||
i2c_del_driver(&max17040_i2c_driver);
|
||||
}
|
||||
module_exit(max17040_exit);
|
||||
module_i2c_driver(max17040_i2c_driver);
|
||||
|
||||
MODULE_AUTHOR("Minkyu Kang <mk7.kang@samsung.com>");
|
||||
MODULE_DESCRIPTION("MAX17040 Fuel Gauge");
|
||||
|
|
|
@ -751,18 +751,7 @@ static struct i2c_driver max17042_i2c_driver = {
|
|||
.remove = __devexit_p(max17042_remove),
|
||||
.id_table = max17042_id,
|
||||
};
|
||||
|
||||
static int __init max17042_init(void)
|
||||
{
|
||||
return i2c_add_driver(&max17042_i2c_driver);
|
||||
}
|
||||
module_init(max17042_init);
|
||||
|
||||
static void __exit max17042_exit(void)
|
||||
{
|
||||
i2c_del_driver(&max17042_i2c_driver);
|
||||
}
|
||||
module_exit(max17042_exit);
|
||||
module_i2c_driver(max17042_i2c_driver);
|
||||
|
||||
MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
|
||||
MODULE_DESCRIPTION("MAX17042 Fuel Gauge");
|
||||
|
|
|
@ -852,18 +852,7 @@ static struct i2c_driver sbs_battery_driver = {
|
|||
.of_match_table = sbs_dt_ids,
|
||||
},
|
||||
};
|
||||
|
||||
static int __init sbs_battery_init(void)
|
||||
{
|
||||
return i2c_add_driver(&sbs_battery_driver);
|
||||
}
|
||||
module_init(sbs_battery_init);
|
||||
|
||||
static void __exit sbs_battery_exit(void)
|
||||
{
|
||||
i2c_del_driver(&sbs_battery_driver);
|
||||
}
|
||||
module_exit(sbs_battery_exit);
|
||||
module_i2c_driver(sbs_battery_driver);
|
||||
|
||||
MODULE_DESCRIPTION("SBS battery monitor driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
@ -316,19 +316,7 @@ static struct i2c_driver z2_batt_driver = {
|
|||
.remove = __devexit_p(z2_batt_remove),
|
||||
.id_table = z2_batt_id,
|
||||
};
|
||||
|
||||
static int __init z2_batt_init(void)
|
||||
{
|
||||
return i2c_add_driver(&z2_batt_driver);
|
||||
}
|
||||
|
||||
static void __exit z2_batt_exit(void)
|
||||
{
|
||||
i2c_del_driver(&z2_batt_driver);
|
||||
}
|
||||
|
||||
module_init(z2_batt_init);
|
||||
module_exit(z2_batt_exit);
|
||||
module_i2c_driver(z2_batt_driver);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Peter Edwards <sweetlilmre@gmail.com>");
|
||||
|
|
Loading…
Reference in a new issue