public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
To: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	"Ivan T. Ivanov" <iivanov@mm-sol.com>
Subject: Re: [PATCH v2] pinctrl: qcom: remove gpiochip in failure cases
Date: Fri, 29 Aug 2014 11:57:46 -0700	[thread overview]
Message-ID: <20140829185744.GK12494@sonymobile.com> (raw)
In-Reply-To: <1409299909-5128-1-git-send-email-pramod.gurav@smartplayin.com>

On Fri 29 Aug 01:11 PDT 2014, Pramod Gurav wrote:

> This patch releases gpiochip related resources by calling
> gpiochip_remove when either of gpiochip_add_pin_range and
> gpiochip_irqchip_add fails.
> 
> CC: Linus Walleij <linus.walleij@linaro.org>
> CC: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> CC: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>

Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>

> ---
> 
> Changes since v1:
> - In v1 of this patch gpiochip_remove was called only in failure case of
>   gpiochip_irqchip_add. This patchs adds a call to gpiochip_remove in failure
>   case of gpiochip_add_pin_range as well.
> 
>  drivers/pinctrl/qcom/pinctrl-msm.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index 2738108..9175bbc 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -829,6 +829,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
>  	ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), 0, 0, chip->ngpio);
>  	if (ret) {
>  		dev_err(pctrl->dev, "Failed to add pin range\n");
> +		gpiochip_remove(&pctrl->chip);
>  		return ret;
>  	}
>  
> @@ -839,6 +840,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
>  				   IRQ_TYPE_NONE);
>  	if (ret) {
>  		dev_err(pctrl->dev, "Failed to add irqchip to gpiochip\n");
> +		gpiochip_remove(&pctrl->chip);
>  		return -ENOSYS;
>  	}
>  

It seems like pinctrl-st.c and pinctrl-sirf.c is suffering the same problem,
would you mind spinning patches for those too?

Regards,
Bjorn

  reply	other threads:[~2014-08-29 18:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29  8:11 [PATCH v2] pinctrl: qcom: remove gpiochip in failure cases Pramod Gurav
2014-08-29 18:57 ` Bjorn Andersson [this message]
2014-08-30  5:01   ` Pramod Gurav
2014-08-30  5:06   ` Pramod Gurav
2014-09-02 12:28 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140829185744.GK12494@sonymobile.com \
    --to=bjorn.andersson@sonymobile.com \
    --cc=iivanov@mm-sol.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pramod.gurav@smartplayin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox