Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: max77686: Use module_platform_driver() instead subsys initcall

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>

authored by

Javier Martinez Canillas and committed by
Mark Brown
314a8203 f55532a0

+1 -11
+1 -11
drivers/regulator/max77686-regulator.c
··· 553 553 .id_table = max77686_pmic_id, 554 554 }; 555 555 556 - static int __init max77686_pmic_init(void) 557 - { 558 - return platform_driver_register(&max77686_pmic_driver); 559 - } 560 - subsys_initcall(max77686_pmic_init); 561 - 562 - static void __exit max77686_pmic_cleanup(void) 563 - { 564 - platform_driver_unregister(&max77686_pmic_driver); 565 - } 566 - module_exit(max77686_pmic_cleanup); 556 + module_platform_driver(max77686_pmic_driver); 567 557 568 558 MODULE_DESCRIPTION("MAXIM 77686 Regulator Driver"); 569 559 MODULE_AUTHOR("Chiwoong Byun <woong.byun@samsung.com>");