extcon: max77843: convert to module_platform_driver()
Subsystems (2)
PATCH v2 1/1 extcon: max77843: convert to module_platform_driver()
This driver is currently registered at the subsys_initcall level, however this driver shouldn't be needed for early boot, and can be converted to use the standard module_init().
This driver already has the standard MODULE_DEVICE_TABLE(), is configured in the Kconfig to be a tristate, and the driver doesn't have suppress_bind_attrs set, so let's go ahead and reduce boilerplate code in this driver and convert it over to use the macro module_platform_driver().
Note that currently there is no __exit function defined and this change will add an __exit function that unregisters the platform driver.
---
Changes in v2:
- Change from module_platform_driver() to subsys_platform_driver() (Krzk)
- Link to v1: https://patch.msgid.link/[email protected]
--- drivers/extcon/extcon-max77843.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/extcon/extcon-max77843.c +1 -5
@@ -960,11 +960,7 @@ static struct platform_driver max77843_muic_driver = { .id_table = max77843_muic_id, }; -static int __init max77843_muic_init (void ) -{ -return platform_driver_register (&max77843_muic_driver); -} -subsys_initcall (max77843_muic_init); +module_platform_driver (max77843_muic_driver);MODULE_DESCRIPTION ("Maxim MAX77843 Extcon driver" );MODULE_AUTHOR ("Jaewon Kim <[email protected]>" );
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
change-id: 20261106-extcon-subsys-24280aaba499
Best regards,
Signature · 1 line
Brian Masney <[email protected]>
Chanwoo Choi
AppliedQuoted 46 lines · Brian Masney
This driver is currently registered at the
subsys_initcalllevel, however this driver shouldn't be needed for early boot, and can be converted to use the standardmodule_init().This driver already has the standard
MODULE_DEVICE_TABLE(), is configured in theKconfigto be a tristate, and the driver doesn't havesuppress_bind_attrsset, so let's go ahead and reduce boilerplate code in this driver and convert it over to use the macromodule_platform_driver().Note that currently there is no
__exitfunction defined and this change will add an__exitfunction that unregisters the platform driver.Reviewed-by Krzysztof Kozlowski <[email protected]>Signed-off-by Brian Masney <[email protected]>---
Changes in v2:
- Change frommodule_platform_driver()tosubsys_platform_driver()(Krzk)
- Link to v1: https://patch.msgid.link/[email protected]--- drivers/extcon/extcon-max77843.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/extcon/extcon-max77843.c +1
-6@@ -960,11 +960,7 @@ static struct platform_driver max77843_muic_driver = { .id_table = max77843_muic_id, }; -static int __init max77843_muic_init (void ) -{ -return platform_driver_register (&max77843_muic_driver); -} -subsys_initcall (max77843_muic_init); +module_platform_driver (max77843_muic_driver);MODULE_DESCRIPTION ("Maxim MAX77843 Extcon driver" );MODULE_AUTHOR ("Jaewon Kim <[email protected]>" ); ---base-commit:
ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
base-tree:git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gitmaster
change-id: 20261106-extcon-subsys-24280aaba499
Quoted 3 lines
Best regards,
Signature · 1 line
Brian Masney <[email protected]>
Applied it. Thanks.
Signature · 3 lines
Best Regards, Chanwoo Choi Principal Engineer, Samsung Electronics