da9052-battery: Convert to use module_platform_driver
authorAxel Lin <axel.lin@gmail.com>
Wed, 11 Jan 2012 07:45:56 +0000 (15:45 +0800)
committerAnton Vorontsov <anton.vorontsov@linaro.org>
Mon, 26 Mar 2012 16:41:17 +0000 (20:41 +0400)
Use the module_platform_driver() macro which makes the code smaller
and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
drivers/power/da9052-battery.c

index daf52a4b17bbf7abcc40d7c7d96fece7295ec082..a5f6a0ec15726b8e93180ea51b1a4facde4474a5 100644 (file)
@@ -647,18 +647,7 @@ static struct platform_driver da9052_bat_driver = {
                .owner = THIS_MODULE,
        },
 };
-
-static int __init da9052_bat_init(void)
-{
-       return platform_driver_register(&da9052_bat_driver);
-}
-module_init(da9052_bat_init);
-
-static void __exit da9052_bat_exit(void)
-{
-       platform_driver_unregister(&da9052_bat_driver);
-}
-module_exit(da9052_bat_exit);
+module_platform_driver(da9052_bat_driver);
 
 MODULE_DESCRIPTION("DA9052 BAT Device Driver");
 MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");