Re: [PATCH] power_supply: Convert power_supply i2c drivers to module_i2c_driver
From: Ryan Mallon
Date: Sat Jan 21 2012 - 02:54:32 EST
On 21/01/12 17:42, Axel Lin wrote:
> Factor out some boilerplate code for i2c driver registration
> into module_i2c_driver.
>
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
> Cc: Ryan Mallon <rmallon@xxxxxxxxx>
> Cc: Woogyom Kim <milo.kim@xxxxxx>
> Cc: Daniel Jeong <daniel.jeong@xxxxxx>
> Cc: Minkyu Kang <mk7.kang@xxxxxxxxxxx>
> Cc: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx>
> Cc: Rhyland Klein <rklein@xxxxxxxxxx>
> Cc: Peter Edwards <sweetlilmre@xxxxxxxxx>
> ---
> drivers/power/ds2782_battery.c | 12 +-----------
> drivers/power/lp8727_charger.c | 13 +------------
> drivers/power/max17040_battery.c | 12 +-----------
> drivers/power/max17042_battery.c | 12 +-----------
> drivers/power/sbs-battery.c | 12 +-----------
> drivers/power/z2_battery.c | 13 +------------
> 6 files changed, 6 insertions(+), 68 deletions(-)
>
> diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
> index bfbce5d..6e3d76a 100644
> --- a/drivers/power/ds2782_battery.c
> +++ b/drivers/power/ds2782_battery.c
> @@ -404,17 +404,7 @@ static struct i2c_driver ds278x_battery_driver = {
> .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");
For ds2782:
Acked-by: Ryan Mallon <rmallon@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/