* [PATCH] gpio/stmpe: Correct cleanup for no-irq mode
@ 2012-01-24 23:06 Linus Walleij
2012-01-25 3:40 ` Viresh Kumar
2012-01-25 9:55 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Linus Walleij @ 2012-01-24 23:06 UTC (permalink / raw)
To: Samuel Ortiz, linux-kernel, Grant Likely; +Cc: Viresh Kumar, Chris Blair
From: Chris Blair <chris.blair@stericsson.com>
Corrects error condition and driver removal cleanup for the no-irq
configuration.
Cc: Viresh Kumar <viresh.kumar@st.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Chris Blair <chris.blair@stericsson.com>
---
This depends on the previous patch to the MFD code so should
better be merged into the MFD tree with the previous patch.
---
drivers/gpio/gpio-stmpe.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index 87a68a8..1008c7c 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -361,9 +361,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
return 0;
out_freeirq:
- free_irq(irq, stmpe_gpio);
+ if (!stmpe->pdata->no_irq)
+ free_irq(irq, stmpe_gpio);
out_removeirq:
- stmpe_gpio_irq_remove(stmpe_gpio);
+ if (!stmpe->pdata->no_irq)
+ stmpe_gpio_irq_remove(stmpe_gpio);
out_disable:
stmpe_disable(stmpe, STMPE_BLOCK_GPIO);
out_free:
@@ -391,8 +393,10 @@ static int __devexit stmpe_gpio_remove(struct platform_device *pdev)
stmpe_disable(stmpe, STMPE_BLOCK_GPIO);
- free_irq(irq, stmpe_gpio);
- stmpe_gpio_irq_remove(stmpe_gpio);
+ if (!stmpe->pdata->no_irq) {
+ free_irq(irq, stmpe_gpio);
+ stmpe_gpio_irq_remove(stmpe_gpio);
+ }
platform_set_drvdata(pdev, NULL);
kfree(stmpe_gpio);
--
1.7.8
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio/stmpe: Correct cleanup for no-irq mode
2012-01-24 23:06 [PATCH] gpio/stmpe: Correct cleanup for no-irq mode Linus Walleij
@ 2012-01-25 3:40 ` Viresh Kumar
2012-01-25 9:55 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2012-01-25 3:40 UTC (permalink / raw)
To: Linus WALLEIJ; +Cc: Samuel Ortiz, linux-kernel, Grant Likely, Christopher BLAIR
On 1/25/2012 4:36 AM, Linus WALLEIJ wrote:
> From: Chris Blair <chris.blair@stericsson.com>
>
> Corrects error condition and driver removal cleanup for the no-irq
> configuration.
>
> Cc: Viresh Kumar <viresh.kumar@st.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Chris Blair <chris.blair@stericsson.com>
> ---
> This depends on the previous patch to the MFD code so should
> better be merged into the MFD tree with the previous patch.
> ---
> drivers/gpio/gpio-stmpe.c | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
> index 87a68a8..1008c7c 100644
> --- a/drivers/gpio/gpio-stmpe.c
> +++ b/drivers/gpio/gpio-stmpe.c
> @@ -361,9 +361,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
> return 0;
>
> out_freeirq:
> - free_irq(irq, stmpe_gpio);
> + if (!stmpe->pdata->no_irq)
> + free_irq(irq, stmpe_gpio);
> out_removeirq:
> - stmpe_gpio_irq_remove(stmpe_gpio);
> + if (!stmpe->pdata->no_irq)
> + stmpe_gpio_irq_remove(stmpe_gpio);
> out_disable:
> stmpe_disable(stmpe, STMPE_BLOCK_GPIO);
> out_free:
> @@ -391,8 +393,10 @@ static int __devexit stmpe_gpio_remove(struct platform_device *pdev)
>
> stmpe_disable(stmpe, STMPE_BLOCK_GPIO);
>
> - free_irq(irq, stmpe_gpio);
> - stmpe_gpio_irq_remove(stmpe_gpio);
> + if (!stmpe->pdata->no_irq) {
> + free_irq(irq, stmpe_gpio);
> + stmpe_gpio_irq_remove(stmpe_gpio);
> + }
> platform_set_drvdata(pdev, NULL);
> kfree(stmpe_gpio);
>
Please check others stmpe drivers too, stmpe-ts & stmpe-keypad. :)
Acked-by: Viresh Kumar <viresh.kumar@st.com>
--
viresh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio/stmpe: Correct cleanup for no-irq mode
2012-01-24 23:06 [PATCH] gpio/stmpe: Correct cleanup for no-irq mode Linus Walleij
2012-01-25 3:40 ` Viresh Kumar
@ 2012-01-25 9:55 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-01-25 9:55 UTC (permalink / raw)
To: Linus Walleij
Cc: Samuel Ortiz, linux-kernel, Grant Likely, Viresh Kumar, Chris Blair
On Wed, Jan 25, 2012 at 12:06 AM, Linus Walleij
<linus.walleij@stericsson.com> wrote:
> From: Chris Blair <chris.blair@stericsson.com>
>
> Corrects error condition and driver removal cleanup for the no-irq
> configuration.
>
> Cc: Viresh Kumar <viresh.kumar@st.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Signed-off-by: Chris Blair <chris.blair@stericsson.com>
Hm, some stuff was missing from this patch (my fault).
Please see patch with subject:
"[PATCH v2] gpio/stmpe: support no-irq mode"
For a follow-up.
Viresh, I bravely included your Acked-by on that patch,
beat me up if there's something wrong...
Thanks,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-25 9:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-24 23:06 [PATCH] gpio/stmpe: Correct cleanup for no-irq mode Linus Walleij
2012-01-25 3:40 ` Viresh Kumar
2012-01-25 9:55 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).