[PATCH v2] pinctrl: st: remove gpiochip in failure cases

Srinivas Kandagatla srinivas.kandagatla at linaro.org
Tue Sep 9 04:27:22 PDT 2014


Acked-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>


On 09/09/14 08:51, Pramod Gurav wrote:
> This patch releases gpiochip related resources by calling
> gpiochip_remove when gpiochip_irqchip_add fails.
>
> CC: Srinivas Kandagatla <srinivas.kandagatla at gmail.com>
> CC: Srinivas Kandagatla <srinivas.kandagatla at linaro.com>
> CC: Maxime Coquelin <maxime.coquelin at st.com>
> CC: Patrice Chotard <patrice.chotard at st.com>
> CC: Linus Walleij <linus.walleij at linaro.org>
> CC: Bjorn Andersson <bjorn.andersson at sonymobile.com>
>
> Signed-off-by: Pramod Gurav <pramod.gurav at 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;
>   		}
>



More information about the linux-arm-kernel mailing list