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

CC: Srinivas Kandagatla <[email protected]>
CC: Srinivas Kandagatla <[email protected]>
CC: Maxime Coquelin <[email protected]>
CC: Patrice Chotard <[email protected]>
CC: Linus Walleij <[email protected]>
CC: Bjorn Andersson <[email protected]>

Signed-off-by: Pramod Gurav <[email protected]>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to