* [PATCH] extcon: max77843: convert to subsys_platform_driver()
@ 2026-11-07 1:07 Brian Masney
2026-11-07 10:46 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: Brian Masney @ 2026-11-07 1:07 UTC (permalink / raw)
To: Chanwoo Choi, Krzysztof Kozlowski, MyungJoo Ham
Cc: linux-kernel, Brian Masney
Reduce boilerplate code in this driver and convert it over to use
the macro subsys_platform_driver().
Note that this driver is configured in the Kconfig to be a tristate,
the driver doesn't have suppress_bind_attrs set, and there is no __exit
function defined. This change will add an __exit function that
unregisters the platform driver.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/extcon/extcon-max77843.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index 2ae9f7f1a67f..6adc4cd6f94a 100644
--- a/drivers/extcon/extcon-max77843.c
+++ b/drivers/extcon/extcon-max77843.c
@@ -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);
+subsys_platform_driver(max77843_muic_driver);
MODULE_DESCRIPTION("Maxim MAX77843 Extcon driver");
MODULE_AUTHOR("Jaewon Kim <jaewon02.kim@samsung.com>");
---
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,
--
Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: max77843: convert to subsys_platform_driver()
2026-11-07 1:07 [PATCH] extcon: max77843: convert to subsys_platform_driver() Brian Masney
@ 2026-11-07 10:46 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-07 10:46 UTC (permalink / raw)
To: Brian Masney, Chanwoo Choi, MyungJoo Ham; +Cc: linux-kernel
On 07/11/2026 02:07, Brian Masney wrote:
> Reduce boilerplate code in this driver and convert it over to use
> the macro subsys_platform_driver().
>
> Note that this driver is configured in the Kconfig to be a tristate,
> the driver doesn't have suppress_bind_attrs set, and there is no __exit
> function defined. This change will add an __exit function that
> unregisters the platform driver.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
> drivers/extcon/extcon-max77843.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
I am 99% sure that this driver can function as module platform driver,
because it has necessary MODULE_DEVICE_TABLE() and device is not needed
for early boot.
Nevertheless, this change itself is also correct.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-07 10:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-07 1:07 [PATCH] extcon: max77843: convert to subsys_platform_driver() Brian Masney
2026-11-07 10:46 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®