Commit 7471725f authored by Pramod Gurav's avatar Pramod Gurav Committed by Linus Walleij

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 <maxime.coquelin@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Acked-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarPramod Gurav <pramod.gurav@smartplayin.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 834e1678
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment