* [PATCH] i2c: Convert to subsys_platform_driver()
@ 2026-11-04 11:33 Peng Fan (OSS)
2026-11-04 11:45 ` Vladimir Zapolskiy
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Peng Fan (OSS) @ 2026-11-04 11:33 UTC (permalink / raw)
To: Codrin Ciubotariu, Andi Shyti, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Bartosz Golaszewski, Mika Westerberg,
Andy Shevchenko, Oleksij Rempel, Pengutronix Kernel Team,
Frank Li, Sascha Hauer, Fabio Estevam, Vignesh R, Aaro Koskinen,
Janusz Krzysztofik, Tony Lindgren, Andreas Kemnade, Kevin Hilman,
Roger Quadros, Vladimir Zapolskiy, Piotr Wojtaszczyk,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Wolfram Sang,
Linus Walleij
Cc: linux-i2c, linux-arm-kernel, linux-kernel, imx, linux-omap,
linux-samsung-soc, linux-renesas-soc
From: Peng Fan <peng.fan@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@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(-)
diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c
index 8ca4556d9664..67727e7287ae 100644
--- a/drivers/i2c/busses/i2c-at91-core.c
+++ b/drivers/i2c/busses/i2c-at91-core.c
@@ -341,18 +341,7 @@ static struct platform_driver at91_twi_driver = {
},
};
-static int __init at91_twi_init(void)
-{
- return platform_driver_register(&at91_twi_driver);
-}
-
-static void __exit at91_twi_exit(void)
-{
- platform_driver_unregister(&at91_twi_driver);
-}
-
-subsys_initcall(at91_twi_init);
-module_exit(at91_twi_exit);
+subsys_platform_driver(at91_twi_driver);
MODULE_AUTHOR("Nikolaus Voss <n.voss@weinmann.de>");
MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91");
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index e15eef163a8f..b7afdf22fad5 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -896,19 +896,7 @@ static struct platform_driver davinci_i2c_driver = {
.of_match_table = davinci_i2c_of_match,
},
};
-
-/* I2C may be needed to bring up other drivers */
-static int __init davinci_i2c_init_driver(void)
-{
- return platform_driver_register(&davinci_i2c_driver);
-}
-subsys_initcall(davinci_i2c_init_driver);
-
-static void __exit davinci_i2c_exit_driver(void)
-{
- platform_driver_unregister(&davinci_i2c_driver);
-}
-module_exit(davinci_i2c_exit_driver);
+subsys_platform_driver(davinci_i2c_driver);
MODULE_AUTHOR("Texas Instruments India");
MODULE_DESCRIPTION("TI DaVinci I2C bus adapter");
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 1da6b0314b6a..0f7d564bd187 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -315,18 +315,7 @@ static struct platform_driver dw_i2c_driver = {
},
.id_table = dw_i2c_platform_ids,
};
-
-static int __init dw_i2c_init_driver(void)
-{
- return platform_driver_register(&dw_i2c_driver);
-}
-subsys_initcall(dw_i2c_init_driver);
-
-static void __exit dw_i2c_exit_driver(void)
-{
- platform_driver_unregister(&dw_i2c_driver);
-}
-module_exit(dw_i2c_exit_driver);
+subsys_platform_driver(dw_i2c_driver);
MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>");
MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter");
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index ccf08cd63151..fff31638cb8e 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -2126,18 +2126,7 @@ static struct platform_driver i2c_imx_driver = {
},
.id_table = imx_i2c_devtype,
};
-
-static int __init i2c_adap_imx_init(void)
-{
- return platform_driver_register(&i2c_imx_driver);
-}
-subsys_initcall(i2c_adap_imx_init);
-
-static void __exit i2c_adap_imx_exit(void)
-{
- platform_driver_unregister(&i2c_imx_driver);
-}
-module_exit(i2c_adap_imx_exit);
+subsys_platform_driver(i2c_imx_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Darius Augulis");
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index eee4fdcd9df3..ad0b1e911dfe 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -888,18 +888,7 @@ static struct platform_driver mxs_i2c_driver = {
.probe = mxs_i2c_probe,
.remove = mxs_i2c_remove,
};
-
-static int __init mxs_i2c_init(void)
-{
- return platform_driver_register(&mxs_i2c_driver);
-}
-subsys_initcall(mxs_i2c_init);
-
-static void __exit mxs_i2c_exit(void)
-{
- platform_driver_unregister(&mxs_i2c_driver);
-}
-module_exit(mxs_i2c_exit);
+subsys_platform_driver(mxs_i2c_driver);
MODULE_AUTHOR("Marek Vasut <marex@denx.de>");
MODULE_AUTHOR("Wolfram Sang <kernel@pengutronix.de>");
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index bd659dfa702f..cd4d6d6b32c6 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1611,20 +1611,7 @@ static struct platform_driver omap_i2c_driver = {
.of_match_table = of_match_ptr(omap_i2c_of_match),
},
};
-
-/* I2C may be needed to bring up other drivers */
-static int __init
-omap_i2c_init_driver(void)
-{
- return platform_driver_register(&omap_i2c_driver);
-}
-subsys_initcall(omap_i2c_init_driver);
-
-static void __exit omap_i2c_exit_driver(void)
-{
- platform_driver_unregister(&omap_i2c_driver);
-}
-module_exit(omap_i2c_exit_driver);
+subsys_platform_driver(omap_i2c_driver);
MODULE_AUTHOR("MontaVista Software, Inc. (and others)");
MODULE_DESCRIPTION("TI OMAP I2C bus adapter");
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index e1cc2b2bd628..9a9a12b7e981 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -735,16 +735,6 @@ static struct platform_driver i2c_pnx_driver = {
.remove = i2c_pnx_remove,
};
-static int __init i2c_adap_pnx_init(void)
-{
- return platform_driver_register(&i2c_pnx_driver);
-}
-
-static void __exit i2c_adap_pnx_exit(void)
-{
- platform_driver_unregister(&i2c_pnx_driver);
-}
-
MODULE_AUTHOR("Vitaly Wool");
MODULE_AUTHOR("Dennis Kovalev <source@mvista.com>");
MODULE_DESCRIPTION("I2C driver for Philips IP3204-based I2C busses");
@@ -752,5 +742,4 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:pnx-i2c");
/* We need to make sure I2C is initialized before USB */
-subsys_initcall(i2c_adap_pnx_init);
-module_exit(i2c_adap_pnx_exit);
+subsys_platform_driver(i2c_pnx_driver);
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index c9927a389aaf..f045d0c2c54b 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1607,18 +1607,7 @@ static struct platform_driver i2c_pxa_driver = {
.id_table = i2c_pxa_id_table,
};
-static int __init i2c_adap_pxa_init(void)
-{
- return platform_driver_register(&i2c_pxa_driver);
-}
-
-static void __exit i2c_adap_pxa_exit(void)
-{
- platform_driver_unregister(&i2c_pxa_driver);
-}
-
MODULE_DESCRIPTION("Intel PXA2XX I2C adapter");
MODULE_LICENSE("GPL");
-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);
MODULE_DESCRIPTION("S3C24XX I2C Bus driver");
MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 3a55f803e4f1..1ecf14890209 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -986,18 +986,7 @@ static struct platform_driver sh_mobile_i2c_driver = {
.probe = sh_mobile_i2c_probe,
.remove = sh_mobile_i2c_remove,
};
-
-static int __init sh_mobile_i2c_adap_init(void)
-{
- return platform_driver_register(&sh_mobile_i2c_driver);
-}
-subsys_initcall(sh_mobile_i2c_adap_init);
-
-static void __exit sh_mobile_i2c_adap_exit(void)
-{
- platform_driver_unregister(&sh_mobile_i2c_driver);
-}
-module_exit(sh_mobile_i2c_adap_exit);
+subsys_platform_driver(sh_mobile_i2c_driver);
MODULE_DESCRIPTION("SuperH Mobile I2C Bus Controller driver");
MODULE_AUTHOR("Magnus Damm");
diff --git a/drivers/i2c/busses/i2c-versatile.c b/drivers/i2c/busses/i2c-versatile.c
index a1ab6ef6f071..152ab19f272a 100644
--- a/drivers/i2c/busses/i2c-versatile.c
+++ b/drivers/i2c/busses/i2c-versatile.c
@@ -116,18 +116,7 @@ static struct platform_driver i2c_versatile_driver = {
},
};
-static int __init i2c_versatile_init(void)
-{
- return platform_driver_register(&i2c_versatile_driver);
-}
-
-static void __exit i2c_versatile_exit(void)
-{
- platform_driver_unregister(&i2c_versatile_driver);
-}
-
-subsys_initcall(i2c_versatile_init);
-module_exit(i2c_versatile_exit);
+subsys_platform_driver(i2c_versatile_driver);
MODULE_DESCRIPTION("ARM Versatile I2C bus driver");
MODULE_LICENSE("GPL");
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: Convert to subsys_platform_driver()
2026-11-04 11:33 [PATCH] i2c: Convert to subsys_platform_driver() Peng Fan (OSS)
@ 2026-11-04 11:45 ` Vladimir Zapolskiy
2026-11-04 11:54 ` Wolfram Sang
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Vladimir Zapolskiy @ 2026-11-04 11:45 UTC (permalink / raw)
To: Peng Fan (OSS), Codrin Ciubotariu, Andi Shyti, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Bartosz Golaszewski,
Mika Westerberg, Andy Shevchenko, Oleksij Rempel,
Pengutronix Kernel Team, Frank Li, Sascha Hauer, Fabio Estevam,
Vignesh R, Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren,
Andreas Kemnade, Kevin Hilman, Roger Quadros, Piotr Wojtaszczyk,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Wolfram Sang,
Linus Walleij
Cc: linux-i2c, linux-arm-kernel, linux-kernel, imx, linux-omap,
linux-samsung-soc, linux-renesas-soc
On 11/4/26 13:33, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@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@nxp.com>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> # I2C PNX
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: Convert to subsys_platform_driver()
2026-11-04 11:33 [PATCH] i2c: Convert to subsys_platform_driver() Peng Fan (OSS)
2026-11-04 11:45 ` Vladimir Zapolskiy
@ 2026-11-04 11:54 ` Wolfram Sang
2026-11-04 14:18 ` Bartosz Golaszewski
2026-11-04 17:38 ` Krzysztof Kozlowski
3 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2026-11-04 11:54 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Codrin Ciubotariu, Andi Shyti, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Bartosz Golaszewski, Mika Westerberg,
Andy Shevchenko, Oleksij Rempel, Pengutronix Kernel Team,
Frank Li, Sascha Hauer, Fabio Estevam, Vignesh R, Aaro Koskinen,
Janusz Krzysztofik, Tony Lindgren, Andreas Kemnade, Kevin Hilman,
Roger Quadros, Vladimir Zapolskiy, Piotr Wojtaszczyk,
Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Linus Walleij,
linux-i2c, linux-arm-kernel, linux-kernel, imx, linux-omap,
linux-samsung-soc, linux-renesas-soc
Hi,
> --- a/drivers/i2c/busses/i2c-davinci.c
> +++ b/drivers/i2c/busses/i2c-davinci.c
> @@ -896,19 +896,7 @@ static struct platform_driver davinci_i2c_driver = {
> .of_match_table = davinci_i2c_of_match,
> },
> };
> -
> -/* I2C may be needed to bring up other drivers */
> -static int __init davinci_i2c_init_driver(void)
I'd vote to keep this comment.
> -{
> - return platform_driver_register(&davinci_i2c_driver);
> -}
> -subsys_initcall(davinci_i2c_init_driver);
> -
> -static void __exit davinci_i2c_exit_driver(void)
> -{
> - platform_driver_unregister(&davinci_i2c_driver);
> -}
> -module_exit(davinci_i2c_exit_driver);
> +subsys_platform_driver(davinci_i2c_driver);
...
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index bd659dfa702f..cd4d6d6b32c6 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -1611,20 +1611,7 @@ static struct platform_driver omap_i2c_driver = {
> .of_match_table = of_match_ptr(omap_i2c_of_match),
> },
> };
> -
> -/* I2C may be needed to bring up other drivers */
Ditto.
> -static int __init
> -omap_i2c_init_driver(void)
> -{
> - return platform_driver_register(&omap_i2c_driver);
> -}
> -subsys_initcall(omap_i2c_init_driver);
> -
> -static void __exit omap_i2c_exit_driver(void)
> -{
> - platform_driver_unregister(&omap_i2c_driver);
> -}
> -module_exit(omap_i2c_exit_driver);
> +subsys_platform_driver(omap_i2c_driver);
>
> MODULE_AUTHOR("MontaVista Software, Inc. (and others)");
> MODULE_DESCRIPTION("TI OMAP I2C bus adapter");
> diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
> index e1cc2b2bd628..9a9a12b7e981 100644
> --- a/drivers/i2c/busses/i2c-pnx.c
> +++ b/drivers/i2c/busses/i2c-pnx.c
> @@ -735,16 +735,6 @@ static struct platform_driver i2c_pnx_driver = {
> .remove = i2c_pnx_remove,
> };
>
> -static int __init i2c_adap_pnx_init(void)
> -{
> - return platform_driver_register(&i2c_pnx_driver);
> -}
> -
> -static void __exit i2c_adap_pnx_exit(void)
> -{
> - platform_driver_unregister(&i2c_pnx_driver);
> -}
> -
> MODULE_AUTHOR("Vitaly Wool");
> MODULE_AUTHOR("Dennis Kovalev <source@mvista.com>");
> MODULE_DESCRIPTION("I2C driver for Philips IP3204-based I2C busses");
> @@ -752,5 +742,4 @@ MODULE_LICENSE("GPL");
> MODULE_ALIAS("platform:pnx-i2c");
>
> /* We need to make sure I2C is initialized before USB */
> -subsys_initcall(i2c_adap_pnx_init);
> -module_exit(i2c_adap_pnx_exit);
> +subsys_platform_driver(i2c_pnx_driver);
Use this occasion to move the comment and your code upwards right below
the driver struct?
> diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
> index 3a55f803e4f1..1ecf14890209 100644
> --- a/drivers/i2c/busses/i2c-sh_mobile.c
> +++ b/drivers/i2c/busses/i2c-sh_mobile.c
> @@ -986,18 +986,7 @@ static struct platform_driver sh_mobile_i2c_driver = {
> .probe = sh_mobile_i2c_probe,
> .remove = sh_mobile_i2c_remove,
> };
> -
> -static int __init sh_mobile_i2c_adap_init(void)
> -{
> - return platform_driver_register(&sh_mobile_i2c_driver);
> -}
> -subsys_initcall(sh_mobile_i2c_adap_init);
> -
> -static void __exit sh_mobile_i2c_adap_exit(void)
> -{
> - platform_driver_unregister(&sh_mobile_i2c_driver);
> -}
> -module_exit(sh_mobile_i2c_adap_exit);
> +subsys_platform_driver(sh_mobile_i2c_driver);
Here you have no empty line after the driver struct...
>
> MODULE_DESCRIPTION("SuperH Mobile I2C Bus Controller driver");
> MODULE_AUTHOR("Magnus Damm");
> diff --git a/drivers/i2c/busses/i2c-versatile.c b/drivers/i2c/busses/i2c-versatile.c
> index a1ab6ef6f071..152ab19f272a 100644
> --- a/drivers/i2c/busses/i2c-versatile.c
> +++ b/drivers/i2c/busses/i2c-versatile.c
> @@ -116,18 +116,7 @@ static struct platform_driver i2c_versatile_driver = {
> },
> };
>
> -static int __init i2c_versatile_init(void)
> -{
> - return platform_driver_register(&i2c_versatile_driver);
> -}
> -
> -static void __exit i2c_versatile_exit(void)
> -{
> - platform_driver_unregister(&i2c_versatile_driver);
> -}
> -
> -subsys_initcall(i2c_versatile_init);
> -module_exit(i2c_versatile_exit);
> +subsys_platform_driver(i2c_versatile_driver);
... while you have one here. Please make it consistent to no empty line.
Other than that, looks good.
Happy hacking,
Wolfram
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: Convert to subsys_platform_driver()
2026-11-04 11:33 [PATCH] i2c: Convert to subsys_platform_driver() Peng Fan (OSS)
2026-11-04 11:45 ` Vladimir Zapolskiy
2026-11-04 11:54 ` Wolfram Sang
@ 2026-11-04 14:18 ` Bartosz Golaszewski
2026-11-04 17:38 ` Krzysztof Kozlowski
3 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2026-11-04 14:18 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Codrin Ciubotariu, Andi Shyti, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Mika Westerberg, Andy Shevchenko, Oleksij Rempel,
Pengutronix Kernel Team, Frank Li, Sascha Hauer, Fabio Estevam,
Vignesh R, Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren,
Andreas Kemnade, Kevin Hilman, Roger Quadros, Vladimir Zapolskiy,
Piotr Wojtaszczyk, Krzysztof Kozlowski, Peter Griffin,
Alim Akhtar, Wolfram Sang, Linus Walleij, linux-i2c,
linux-arm-kernel, linux-kernel, imx, linux-omap,
linux-samsung-soc, linux-renesas-soc
On Wed, Nov 04, 2026 at 07:33:16PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@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@nxp.com>
> ---
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: Convert to subsys_platform_driver()
2026-11-04 11:33 [PATCH] i2c: Convert to subsys_platform_driver() Peng Fan (OSS)
` (2 preceding siblings ...)
2026-11-04 14:18 ` Bartosz Golaszewski
@ 2026-11-04 17:38 ` Krzysztof Kozlowski
3 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-04 17:38 UTC (permalink / raw)
To: Peng Fan (OSS), Codrin Ciubotariu, Andi Shyti, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Bartosz Golaszewski,
Mika Westerberg, Andy Shevchenko, Oleksij Rempel,
Pengutronix Kernel Team, Frank Li, Sascha Hauer, Fabio Estevam,
Vignesh R, Aaro Koskinen, Janusz Krzysztofik, Tony Lindgren,
Andreas Kemnade, Kevin Hilman, Roger Quadros, Vladimir Zapolskiy,
Piotr Wojtaszczyk, Peter Griffin, Alim Akhtar, Wolfram Sang,
Linus Walleij, Andy Shevchenko
Cc: linux-i2c, linux-arm-kernel, linux-kernel, imx, linux-omap,
linux-samsung-soc, linux-renesas-soc
On 04/11/2026 12:33, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@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@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@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-04 17:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 11:33 [PATCH] i2c: Convert to subsys_platform_driver() Peng Fan (OSS)
2026-11-04 11:45 ` Vladimir Zapolskiy
2026-11-04 11:54 ` Wolfram Sang
2026-11-04 14:18 ` Bartosz Golaszewski
2026-11-04 17:38 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox