[PATCH] i2c: Convert to subsys_platform_driver()

Krzysztof Kozlowski krzk at kernel.org
Wed Nov 4 09:38:40 PST 2026


On 04/11/2026 12:33, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan at nxp.com>
> 
> Replace the open-coded subsys_initcall()/module_exit() platform driver
> registration with subsys_platform_driver().
> 
> No functional change.
> 
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
>  drivers/i2c/busses/i2c-at91-core.c          | 13 +------------
>  drivers/i2c/busses/i2c-davinci.c            | 14 +-------------
>  drivers/i2c/busses/i2c-designware-platdrv.c | 13 +------------
>  drivers/i2c/busses/i2c-imx.c                | 13 +------------
>  drivers/i2c/busses/i2c-mxs.c                | 13 +------------
>  drivers/i2c/busses/i2c-omap.c               | 15 +--------------
>  drivers/i2c/busses/i2c-pnx.c                | 13 +------------
>  drivers/i2c/busses/i2c-pxa.c                | 13 +------------
>  drivers/i2c/busses/i2c-s3c2410.c            | 13 +------------
>  drivers/i2c/busses/i2c-sh_mobile.c          | 13 +------------
>  drivers/i2c/busses/i2c-versatile.c          | 13 +------------
>  11 files changed, 11 insertions(+), 135 deletions(-)
> 


> -subsys_initcall(i2c_adap_pxa_init);
> -module_exit(i2c_adap_pxa_exit);
> +subsys_platform_driver(i2c_pxa_driver);
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index 15e14a6fe6dc..dd1f6f854a32 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -1188,18 +1188,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
>  		.of_match_table = of_match_ptr(s3c24xx_i2c_match),
>  	},
>  };
> -
> -static int __init i2c_adap_s3c_init(void)
> -{
> -	return platform_driver_register(&s3c24xx_i2c_driver);
> -}
> -subsys_initcall(i2c_adap_s3c_init);
> -
> -static void __exit i2c_adap_s3c_exit(void)
> -{
> -	platform_driver_unregister(&s3c24xx_i2c_driver);
> -}
> -module_exit(i2c_adap_s3c_exit);
> +subsys_platform_driver(s3c24xx_i2c_driver);

Apparently reviewing only a few lines out of 300 is still reviewing:

https://lore.kernel.org/all/9e39502a-dd17-4fa2-98a3-9019523cb5e8@kernel.org/

Therefore:

Reviewed-by: Krzysztof Kozlowski <krzk at kernel.org>

Best regards,
Krzysztof



More information about the linux-arm-kernel mailing list