public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Chen Gang <gang.chen@asianux.com>
Cc: <grant.likely@secretlab.ca>, <linus.walleij@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH] drivers/gpio/*twl* need call irq_free_descs when leaving
Date: Mon, 18 Feb 2013 10:09:59 +0100	[thread overview]
Message-ID: <5121EFE7.7040301@ti.com> (raw)
In-Reply-To: <511F34C3.6020406@asianux.com>

On 02/16/2013 08:26 AM, Chen Gang wrote:
> 
>   since already call irq_alloc_descs before,
>     we need call irq_free_descs when quiting, or resource leak.

While it is true that we need to free the descs, but this patch is not correct.
We have other issues to fix in the driver - I have not looked at the
probe/remove path yet, but the sequence is not right and also the call of
gpio_twl4030_remove() from probe is not correct.

I'll send a small series to fix these up.

> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  drivers/gpio/gpio-twl4030.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
> index 4d330e3..26aef72 100644
> --- a/drivers/gpio/gpio-twl4030.c
> +++ b/drivers/gpio/gpio-twl4030.c
> @@ -486,8 +486,10 @@ static int gpio_twl4030_probe(struct platform_device *pdev)
>  			      &irq_domain_simple_ops, NULL);
>  
>  	ret = twl4030_sih_setup(&pdev->dev, TWL4030_MODULE_GPIO, irq_base);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		irq_free_descs(irq_base, TWL4030_GPIO_MAX);
>  		return ret;
> +	}
>  
>  	priv->irq_base = irq_base;
>  
> @@ -578,6 +580,7 @@ static int gpio_twl4030_remove(struct platform_device *pdev)
>  
>  	/* REVISIT no support yet for deregistering all the IRQs */
>  	WARN_ON(1);
> +	irq_free_descs(priv->irq_base, TWL4030_GPIO_MAX);
>  	return -EIO;
>  }
>  
> 


-- 
Péter

  reply	other threads:[~2013-02-18  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-16  7:26 [PATCH] drivers/gpio/*twl* need call irq_free_descs when leaving Chen Gang
2013-02-18  9:09 ` Peter Ujfalusi [this message]
2013-02-18  9:13   ` Chen Gang

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=5121EFE7.7040301@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=gang.chen@asianux.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony@atomide.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