spi: convert to subsys_platform_driver()
Subsystems (3)
cover spi: convert to subsys_platform_driver()
Reduce boilerplate code in these drivers and convert them over to use the macro subsys_platform_driver().
---
Brian Masney (2):
spi: omap-uwire: convert to subsys_platform_driver()
spi: pxa2xx: convert to subsys_platform_driver()
drivers/spi/spi-omap-uwire.c | 14 +------------- drivers/spi/spi-pxa2xx-platform.c | 14 ++------------ 2 files changed, 3 insertions(+), 25 deletions(-)
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
change-id: 20261106-spi-subsys-32156ad80403
Best regards,
Signature · 1 line
Brian Masney <[email protected]>
PATCH 1/2 spi: omap-uwire: convert to subsys_platform_driver()
Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().
--- drivers/spi/spi-omap-uwire.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/spi/spi-omap-uwire.c +1 -13
@@ -528,19 +528,7 @@ static struct platform_driver uwire_driver = {// resume ... use ck }; -static int __init omap_uwire_init (void ) -{ -return platform_driver_register (&uwire_driver); -} - -static void __exit omap_uwire_exit(void) -{ -platform_driver_unregister (&uwire_driver); -} - -subsys_initcall (omap_uwire_init); -module_exit (omap_uwire_exit); +subsys_platform_driver (uwire_driver);MODULE_DESCRIPTION ("MicroWire interface driver for OMAP" );MODULE_LICENSE ("GPL" ); -
Signature · 1 line
2.56.0
PATCH 2/2 spi: pxa2xx: convert to subsys_platform_driver()
In reply to Brian MasneyReduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().
Note that this needs to rename the driver variable to pxa2xx_spi_driver to avoid a compilation error with the macro.
--- drivers/spi/spi-pxa2xx-platform.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/spi/spi-pxa2xx-platform.c +2 -12
@@ -198,7 +198,7 @@ static const struct of_device_id pxa2xx_spi_of_match[] = { };MODULE_DEVICE_TABLE (of, pxa2xx_spi_of_match); -static struct platform_driver driver = { +static struct platform_driver pxa2xx_spi_driver = { .driver = { .name ="pxa2xx-spi" , .pm =pm_ptr (&pxa2xx_spi_pm_ops),
@@ -209,17 +209,7 @@ static struct platform_driver driver = { .remove = pxa2xx_spi_platform_remove, }; -static int __init pxa2xx_spi_init (void ) -{ -return platform_driver_register (&driver); -} -subsys_initcall (pxa2xx_spi_init); - -static void __exit pxa2xx_spi_exit(void) -{ -platform_driver_unregister (&driver); -} -module_exit (pxa2xx_spi_exit); +subsys_platform_driver (pxa2xx_spi_driver);MODULE_AUTHOR ("Stephen Street" );MODULE_DESCRIPTION ("PXA2xx SSP SPI Controller platform driver" );
Signature · 1 line
2.56.0
Mark Brown
maintainerQuoted 2 lines · Brian Masney
Reduce boilerplate code in these drivers and convert them over to use the macro
subsys_platform_driver().
This doesn't apply against current code, please check and resend.
Hi Mark,
Quoted 5 lines · Mark Brown
Quoted 2 lines · Brian Masney
Reduce boilerplate code in these drivers and convert them over to use the macro
subsys_platform_driver().This doesn't apply against current code, please check and resend.
I see that Peng Fan already beat me to this! There's nothing else to add from my series, so there will be no follow up from me.
Peng: Just a heads up that I posted patches across the tree Friday for this migrated. I think I changed everything that can be easily migrated. I suspect we may have collided in other subsystems.
Brian
Hi Brian,
Quoted 7 lines · Brian Masney
Hi Mark,
Quoted 4 lines · Mark Brown
Quoted 2 lines · Brian Masney
Reduce boilerplate code in these drivers and convert them over to use the macro
subsys_platform_driver().
Quoted 8 lines
Quoted 1 line
This doesn't apply against current code, please check and resend.
I see that Peng Fan already beat me to this! There's nothing else to add from my series, so there will be no follow up from me.
Peng: Just a heads up that I posted patches across the tree Friday for this migrated. I think I changed everything that can be easily migrated. I suspect we may have collided in other subsystems.
Thanks for the heads up.
I wasn't aware of your earlier treewide conversion series. Sorry for the duplicated effort.
I generated these conversions using a Coccinelle rule and it appears to have covered most of the straightforward subsys_platform_driver() conversions across the tree. If there are any overlaps in other subsystems, I can the corresponding parts from my series.
Thanks
Peng
Quoted 5 lines
Brian