Skip to contentSkip to conversation

gpio: convert to subsys_platform_driver() and subsys_platform_driver_probe()

PATCH Applied Brian Masney 2 participants 4 messages Nov 7 – Nov 9 GPIO

lore
Share & tools
lore
#0 lore raw

cover gpio: convert to subsys_platform_driver() and subsys_platform_driver_probe()

Reduce boilerplate code in these drivers and convert them over to use the macros subsys_platform_driver() and subsys_platform_driver_probe().

---
Brian Masney (2):
gpio: htc-egpio: convert to subsys_platform_driver_probe()
gpio: tps6586x: convert to subsys_platform_driver()

 drivers/gpio/gpio-htc-egpio.c | 6 +-----
 drivers/gpio/gpio-tps6586x.c  | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
change-id: 20261106-gpio-subsys-d69c66fb9fff

Best regards,

Signature · 1 line
Brian Masney <[email protected]>
#1 lore raw

PATCH 1/2 gpio: htc-egpio: convert to subsys_platform_driver_probe()

Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver_probe().

---
 drivers/gpio/gpio-htc-egpio.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpio/gpio-htc-egpio.c +1 -5
index 25a4d4494f3c..0e108d4236d2 100644
@@ -395,9 +395,5 @@ static struct platform_driver egpio_driver = {
 	},
 };
 
-static int __init egpio_init(void)
-{
-	return platform_driver_probe(&egpio_driver, egpio_probe);
-}
 /* start early for dependencies */
-subsys_initcall(egpio_init);
+subsys_platform_driver_probe(egpio_driver, egpio_probe);
Signature · 1 line
2.56.0
#2 lore raw

PATCH 2/2 gpio: tps6586x: convert to subsys_platform_driver()

In reply to Brian Masney

Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().

---
 drivers/gpio/gpio-tps6586x.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpio/gpio-tps6586x.c +1 -5
index aaacbb54bf5d..e19af562ec3a 100644
@@ -116,8 +116,4 @@ static struct platform_driver tps6586x_gpio_driver = {
 	.probe		= tps6586x_gpio_probe,
 };
 
-static int __init tps6586x_gpio_init(void)
-{
-	return platform_driver_register(&tps6586x_gpio_driver);
-}
-subsys_initcall(tps6586x_gpio_init);
+subsys_platform_driver(tps6586x_gpio_driver);
Signature · 1 line
2.56.0
#3 lore raw
In reply to Brian Masney
Quoted 4 lines · Brian Masney

Reduce boilerplate code in these drivers and convert them over to use the macros subsys_platform_driver() and subsys_platform_driver_probe().

Applied, thanks!

[1/2] gpio: htc-egpio: convert to subsys_platform_driver_probe()

      https://git.kernel.org/brgl/c/fe4afc147b43d578411fda8c360b0505b5b41f6c
[2/2] gpio: tps6586x: convert to subsys_platform_driver()
      https://git.kernel.org/brgl/c/4fc2c9ab68f4324bea62cb5a43e93392225f1d11

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>