mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] pinctrl: st: remove gpiochip in failure cases
@ 2014-09-09  7:51 Pramod Gurav
  2014-09-09 11:27 ` Srinivas Kandagatla
  2014-09-23 14:53 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Pramod Gurav @ 2014-09-09  7:51 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, kernel
  Cc: Srinivas Kandagatla, Srinivas Kandagatla, Maxime Coquelin,
	Patrice Chotard, Linus Walleij, Bjorn Andersson

This patch releases gpiochip related resources by calling
gpiochip_remove when gpiochip_irqchip_add fails.

CC: Srinivas Kandagatla <srinivas.kandagatla@gmail.com>
CC: Srinivas Kandagatla <srinivas.kandagatla@linaro.com>
CC: Maxime Coquelin <maxime.coquelin@st.com>
CC: Patrice Chotard <patrice.chotard@st.com>
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Bjorn Andersson <bjorn.andersson@sonymobile.com>

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
---
Changes since v1:
Dropped adding remove function as it will never be tested as 
the driver is bool.

 drivers/pinctrl/pinctrl-st.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 5475374..af2f589 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -1517,6 +1517,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
 					   0, handle_simple_irq,
 					   IRQ_TYPE_LEVEL_LOW);
 		if (err) {
+			gpiochip_remove(&bank->gpio_chip);
 			dev_info(dev, "could not add irqchip\n");
 			return err;
 		}
-- 
1.7.9.5


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

end of thread, other threads:[~2014-09-23 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-09  7:51 [PATCH v2] pinctrl: st: remove gpiochip in failure cases Pramod Gurav
2014-09-09 11:27 ` Srinivas Kandagatla
2014-09-23 14:53 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome