regulator: s2mps11: Use module_platform_driver() instead subsys initcall
authorJavier Martinez Canillas <javier@osg.samsung.com>
Wed, 6 Apr 2016 13:49:46 +0000 (09:49 -0400)
committerMark Brown <broonie@kernel.org>
Wed, 6 Apr 2016 17:12:00 +0000 (10:12 -0700)
The driver's init and exit function don't do anything besides registering
and unregistering the platform driver, so the module_platform_driver()
macro could just be used instead of having separate functions.

Currently the macro is not being used because the driver is initialized at
subsys init call level but this isn't necessary since consumer devices are
defined in the DT as dependencies so there's no need for init calls order.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/s2mps11.c

index d24e2c783dc5c9a093220c4e98980813ad9e309f..46e5a2922c4d415bbf416e22aa49a7d064659708 100644 (file)
@@ -1221,17 +1221,7 @@ static struct platform_driver s2mps11_pmic_driver = {
        .id_table = s2mps11_pmic_id,
 };
 
-static int __init s2mps11_pmic_init(void)
-{
-       return platform_driver_register(&s2mps11_pmic_driver);
-}
-subsys_initcall(s2mps11_pmic_init);
-
-static void __exit s2mps11_pmic_exit(void)
-{
-       platform_driver_unregister(&s2mps11_pmic_driver);
-}
-module_exit(s2mps11_pmic_exit);
+module_platform_driver(s2mps11_pmic_driver);
 
 /* Module information */
 MODULE_AUTHOR("Sangbeom Kim <sbkim73@samsung.com>");