* [PATCH] drivers/gpio/*twl* need call irq_free_descs when leaving
@ 2013-02-16 7:26 Chen Gang
2013-02-18 9:09 ` Peter Ujfalusi
0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2013-02-16 7:26 UTC (permalink / raw)
To: Peter Ujfalusi, grant.likely, linus.walleij,
linux-kernel@vger.kernel.org
Cc: Tony Lindgren
since already call irq_alloc_descs before,
we need call irq_free_descs when quiting, or resource leak.
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;
}
--
1.7.7.6
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] drivers/gpio/*twl* need call irq_free_descs when leaving
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
2013-02-18 9:13 ` Chen Gang
0 siblings, 1 reply; 3+ messages in thread
From: Peter Ujfalusi @ 2013-02-18 9:09 UTC (permalink / raw)
To: Chen Gang
Cc: grant.likely, linus.walleij, linux-kernel@vger.kernel.org,
Tony Lindgren
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] drivers/gpio/*twl* need call irq_free_descs when leaving
2013-02-18 9:09 ` Peter Ujfalusi
@ 2013-02-18 9:13 ` Chen Gang
0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2013-02-18 9:13 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: grant.likely, linus.walleij, linux-kernel@vger.kernel.org,
Tony Lindgren
于 2013年02月18日 17:09, Peter Ujfalusi 写道:
> 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.
>
ok, thank you.
:-)
--
Chen Gang
Asianux Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-18 9:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-02-18 9:13 ` Chen Gang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox