linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] gpio: siox: Do not call gpiochip_remove() on errorpath
@ 2019-06-26  8:44 Linus Walleij
  2019-06-26  8:44 ` [PATCH 2/5] gpio: siox: Switch to IRQ_TYPE_NONE Linus Walleij
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Linus Walleij @ 2019-06-26  8:44 UTC (permalink / raw)
  To: linux-gpio; +Cc: Bartosz Golaszewski, Linus Walleij, Uwe Kleine-König

gpiochip_remove() was called on the errorpath if
gpiochip_add() failed: this is wrong, if the chip failed
to add it is not there so it should not be removed.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-siox.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c
index fb4e318ab028..0b4450118865 100644
--- a/drivers/gpio/gpio-siox.c
+++ b/drivers/gpio/gpio-siox.c
@@ -243,17 +243,14 @@ static int gpio_siox_probe(struct siox_device *sdevice)
 	if (ret) {
 		dev_err(&sdevice->dev,
 			"Failed to register gpio chip (%d)\n", ret);
-		goto err_gpiochip;
+		return ret;
 	}
 
 	ret = gpiochip_irqchip_add(&ddata->gchip, &ddata->ichip,
 				   0, handle_level_irq, IRQ_TYPE_EDGE_RISING);
-	if (ret) {
+	if (ret)
 		dev_err(&sdevice->dev,
 			"Failed to register irq chip (%d)\n", ret);
-err_gpiochip:
-		gpiochip_remove(&ddata->gchip);
-	}
 
 	return ret;
 }
-- 
2.20.1


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

end of thread, other threads:[~2019-06-26 11:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-26  8:44 [PATCH 1/5] gpio: siox: Do not call gpiochip_remove() on errorpath Linus Walleij
2019-06-26  8:44 ` [PATCH 2/5] gpio: siox: Switch to IRQ_TYPE_NONE Linus Walleij
2019-06-26  9:12   ` Uwe Kleine-König
2019-06-26  8:44 ` [PATCH 3/5] gpio: siox: Pass irqchip when adding gpiochip Linus Walleij
2019-06-26  9:16   ` Uwe Kleine-König
2019-06-26  8:44 ` [PATCH 4/5] gpio: siox: Add struct device *dev helper variable Linus Walleij
2019-06-26  9:13   ` Uwe Kleine-König
2019-06-26  8:44 ` [PATCH 5/5] gpio: siox: Use devm_ managed gpiochip Linus Walleij
2019-06-26  9:14   ` Uwe Kleine-König
2019-06-26  9:12 ` [PATCH 1/5] gpio: siox: Do not call gpiochip_remove() on errorpath Uwe Kleine-König
2019-06-26 11:49   ` Linus Walleij

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).