From: Pramod Gurav Date: Tue, 9 Sep 2014 07:51:40 +0000 (+0530) Subject: pinctrl: st: remove gpiochip in failure cases X-Git-Tag: v5.15~17143^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7471725f618b95d2a61a4bf789dbdc5c7805ffa9;p=platform%2Fkernel%2Flinux-starfive.git pinctrl: st: remove gpiochip in failure cases This patch releases gpiochip related resources by calling gpiochip_remove when gpiochip_irqchip_add fails. Cc: Maxime Coquelin Cc: Patrice Chotard Cc: Bjorn Andersson Acked-by: Srinivas Kandagatla Signed-off-by: Pramod Gurav Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 6c4c41b..4b1792a 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; }