power: supply: max8997-charger: Use module_platform_driver()
authorTimon Baetz <timon.baetz@protonmail.com>
Mon, 9 Nov 2020 19:43:12 +0000 (19:43 +0000)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 30 Nov 2020 00:56:17 +0000 (01:56 +0100)
Replace register and unregister function calls with
module_platform_driver().

Signed-off-by: Timon Baetz <timon.baetz@protonmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/max8997_charger.c

index f5e84cd..94d1ade 100644 (file)
@@ -168,18 +168,7 @@ static struct platform_driver max8997_battery_driver = {
        .probe = max8997_battery_probe,
        .id_table = max8997_battery_id,
 };
-
-static int __init max8997_battery_init(void)
-{
-       return platform_driver_register(&max8997_battery_driver);
-}
-subsys_initcall(max8997_battery_init);
-
-static void __exit max8997_battery_cleanup(void)
-{
-       platform_driver_unregister(&max8997_battery_driver);
-}
-module_exit(max8997_battery_cleanup);
+module_platform_driver(max8997_battery_driver);
 
 MODULE_DESCRIPTION("MAXIM 8997/8966 battery control driver");
 MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");