Re: [PATCH] extcon: max77843: convert to subsys_platform_driver()
From: Brian Masney
Date: Mon Nov 09 2026 - 09:50:43 EST
On Sat, Nov 07, 2026 at 11:46:57AM +0100, Krzysztof Kozlowski wrote:
> 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@xxxxxxxxxx>
> > ---
> > 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.
I agree and I'll post a v2 that converts it use module_platform_driver()
instead.
> Nevertheless, this change itself is also correct.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
Thanks!
Brian