linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/6] gpio: ich: Use devm_gpiochip_add_data() to simplify remove path
@ 2023-03-07 19:33 Andrew Davis
  2023-03-07 19:33 ` [PATCH v2 2/6] gpio: twl4030: " Andrew Davis
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Andrew Davis @ 2023-03-07 19:33 UTC (permalink / raw)
  To: Peter Tyser, Andy Shevchenko, Linus Walleij, Bartosz Golaszewski
  Cc: linux-gpio, linux-kernel, Andrew Davis

Use devm version of gpiochip add function to handle removal for us.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/gpio/gpio-ich.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
index 3b31f5e9bf40..0be9285efebc 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -457,7 +457,7 @@ static int ichx_gpio_probe(struct platform_device *pdev)
 
 init:
 	ichx_gpiolib_setup(&ichx_priv.chip);
-	err = gpiochip_add_data(&ichx_priv.chip, NULL);
+	err = devm_gpiochip_add_data(dev, &ichx_priv.chip, NULL);
 	if (err) {
 		dev_err(dev, "Failed to register GPIOs\n");
 		return err;
@@ -469,19 +469,11 @@ static int ichx_gpio_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int ichx_gpio_remove(struct platform_device *pdev)
-{
-	gpiochip_remove(&ichx_priv.chip);
-
-	return 0;
-}
-
 static struct platform_driver ichx_gpio_driver = {
 	.driver		= {
 		.name	= DRV_NAME,
 	},
 	.probe		= ichx_gpio_probe,
-	.remove		= ichx_gpio_remove,
 };
 
 module_platform_driver(ichx_gpio_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-09  8:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-07 19:33 [PATCH v2 1/6] gpio: ich: Use devm_gpiochip_add_data() to simplify remove path Andrew Davis
2023-03-07 19:33 ` [PATCH v2 2/6] gpio: twl4030: " Andrew Davis
2023-03-07 19:33 ` [PATCH v2 3/6] gpio: sch311x: " Andrew Davis
2023-03-08  8:39   ` kernel test robot
2023-03-09  8:49   ` kernel test robot
2023-03-07 19:33 ` [PATCH v2 4/6] gpio: pisosr: " Andrew Davis
2023-03-07 19:33 ` [PATCH v2 5/6] gpio: tpic2810: " Andrew Davis
2023-03-07 19:33 ` [PATCH v2 6/6] gpio: tps65086: " Andrew Davis
2023-03-07 19:53 ` [PATCH v2 1/6] gpio: ich: " Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).