Skip to content

Commit

Permalink
ds2781_battery: Convert to module_platform_driver
Browse files Browse the repository at this point in the history
module_platform_driver can be used to replace the platform_driver
register and unregister functions, with the calls to module_init
and module_exit,

i.e. all the code that is doing like the below

static int __init mymod_init(void)
{
	return platform_driver_register(&drv_operations);
}

static void __exit mymod_exit(void)
{
	platform_driver_unregister(&drv_operations);
}

module_init(mymod_init);
module_exit(mymod_exit);

can be replaced with
module_platform_driver(drv_operations)...

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
  • Loading branch information
Devendra Naga authored and Anton Vorontsov committed Aug 23, 2012
1 parent 94b05ca commit bc6e51d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions drivers/power/ds2781_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,20 +834,7 @@ static struct platform_driver ds2781_battery_driver = {
.probe = ds2781_battery_probe,
.remove = __devexit_p(ds2781_battery_remove),
};

static int __init ds2781_battery_init(void)
{
return platform_driver_register(&ds2781_battery_driver);
}

static void __exit ds2781_battery_exit(void)
{
platform_driver_unregister(&ds2781_battery_driver);
}

module_init(ds2781_battery_init);
module_exit(ds2781_battery_exit);

module_platform_driver(ds2781_battery_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Renata Sayakhova <renata@oktetlabs.ru>");
Expand Down

0 comments on commit bc6e51d

Please sign in to comment.