From 300bac7fb85a20b2704dc3645419057992f78565 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 26 Nov 2011 12:01:10 +0800 Subject: power_supply: Convert drivers/power/* to use module_platform_driver() This patch converts the drivers in drivers/power/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Mike Rapoport Cc: Lars-Peter Clausen Cc: Nithish Mahalingam Cc: MyungJoo Ham Cc: Haojian Zhuang Cc: Balaji Rao Cc: Mark Brown Signed-off-by: Axel Lin Acked-by: Clifton Barnes Signed-off-by: Anton Vorontsov --- drivers/power/ds2780_battery.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'drivers/power/ds2780_battery.c') diff --git a/drivers/power/ds2780_battery.c b/drivers/power/ds2780_battery.c index 887ec98d8c22..de31cae1ba53 100644 --- a/drivers/power/ds2780_battery.c +++ b/drivers/power/ds2780_battery.c @@ -841,8 +841,6 @@ static int __devexit ds2780_battery_remove(struct platform_device *pdev) return 0; } -MODULE_ALIAS("platform:ds2780-battery"); - static struct platform_driver ds2780_battery_driver = { .driver = { .name = "ds2780-battery", @@ -851,19 +849,9 @@ static struct platform_driver ds2780_battery_driver = { .remove = __devexit_p(ds2780_battery_remove), }; -static int __init ds2780_battery_init(void) -{ - return platform_driver_register(&ds2780_battery_driver); -} - -static void __exit ds2780_battery_exit(void) -{ - platform_driver_unregister(&ds2780_battery_driver); -} - -module_init(ds2780_battery_init); -module_exit(ds2780_battery_exit); +module_platform_driver(ds2780_battery_driver); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Clifton Barnes "); MODULE_DESCRIPTION("Maxim/Dallas DS2780 Stand-Alone Fuel Gauage IC driver"); +MODULE_ALIAS("platform:ds2780-battery"); -- cgit v1.2.3-59-g8ed1b