* [PATCH] serial: sccnxp: convert devm irq to non devm version
@ 2015-09-13 13:44 Julia Lawall
2015-09-14 16:19 ` Fabio Estevam
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2015-09-13 13:44 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: kernel-janitors, Jiri Slaby, linux-serial, linux-kernel
There seems to be no need to request an irq with a devm function, since the
irq is being freed explicitly.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
Compile tested only.
drivers/tty/serial/sccnxp.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index fcf803f..d0d5fa9 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -963,11 +963,9 @@ static int sccnxp_probe(struct platform_device *pdev)
sccnxp_write(&s->port[0], SCCNXP_IMR_REG, 0);
if (!s->poll) {
- ret = devm_request_threaded_irq(&pdev->dev, s->irq, NULL,
- sccnxp_ist,
- IRQF_TRIGGER_FALLING |
- IRQF_ONESHOT,
- dev_name(&pdev->dev), s);
+ ret = request_threaded_irq(s->irq, NULL, sccnxp_ist,
+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ dev_name(&pdev->dev), s);
if (!ret)
return 0;
@@ -994,7 +992,7 @@ static int sccnxp_remove(struct platform_device *pdev)
struct sccnxp_port *s = platform_get_drvdata(pdev);
if (!s->poll)
- devm_free_irq(&pdev->dev, s->irq, s);
+ free_irq(s->irq, s);
else
del_timer_sync(&s->timer);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] serial: sccnxp: convert devm irq to non devm version
2015-09-13 13:44 [PATCH] serial: sccnxp: convert devm irq to non devm version Julia Lawall
@ 2015-09-14 16:19 ` Fabio Estevam
2015-09-14 18:45 ` Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2015-09-14 16:19 UTC (permalink / raw)
To: Julia Lawall
Cc: Greg Kroah-Hartman, kernel-janitors, Jiri Slaby, linux-serial,
linux-kernel
On Sun, Sep 13, 2015 at 10:44 AM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> --- a/drivers/tty/serial/sccnxp.c
> +++ b/drivers/tty/serial/sccnxp.c
> @@ -963,11 +963,9 @@ static int sccnxp_probe(struct platform_device *pdev)
> sccnxp_write(&s->port[0], SCCNXP_IMR_REG, 0);
>
> if (!s->poll) {
> - ret = devm_request_threaded_irq(&pdev->dev, s->irq, NULL,
> - sccnxp_ist,
> - IRQF_TRIGGER_FALLING |
> - IRQF_ONESHOT,
> - dev_name(&pdev->dev), s);
> + ret = request_threaded_irq(s->irq, NULL, sccnxp_ist,
> + IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> + dev_name(&pdev->dev), s);
> if (!ret)
> return 0;
>
> @@ -994,7 +992,7 @@ static int sccnxp_remove(struct platform_device *pdev)
> struct sccnxp_port *s = platform_get_drvdata(pdev);
>
> if (!s->poll)
> - devm_free_irq(&pdev->dev, s->irq, s);
> + free_irq(s->irq, s);
Couldn't we just remove the devm_free_irq() and keep using
devm_request_threaded_irq()?
Like this:
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -993,9 +993,7 @@ static int sccnxp_remove(struct platform_device *pdev)
int i;
struct sccnxp_port *s = platform_get_drvdata(pdev);
- if (!s->poll)
- devm_free_irq(&pdev->dev, s->irq, s);
- else
+ if (s->poll)
del_timer_sync(&s->timer);
for (i = 0; i < s->uart.nr; i++)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] serial: sccnxp: convert devm irq to non devm version
2015-09-14 16:19 ` Fabio Estevam
@ 2015-09-14 18:45 ` Julia Lawall
0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2015-09-14 18:45 UTC (permalink / raw)
To: Fabio Estevam
Cc: Julia Lawall, Greg Kroah-Hartman, kernel-janitors, Jiri Slaby,
linux-serial, linux-kernel
On Mon, 14 Sep 2015, Fabio Estevam wrote:
> On Sun, Sep 13, 2015 at 10:44 AM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>
> > --- a/drivers/tty/serial/sccnxp.c
> > +++ b/drivers/tty/serial/sccnxp.c
> > @@ -963,11 +963,9 @@ static int sccnxp_probe(struct platform_device *pdev)
> > sccnxp_write(&s->port[0], SCCNXP_IMR_REG, 0);
> >
> > if (!s->poll) {
> > - ret = devm_request_threaded_irq(&pdev->dev, s->irq, NULL,
> > - sccnxp_ist,
> > - IRQF_TRIGGER_FALLING |
> > - IRQF_ONESHOT,
> > - dev_name(&pdev->dev), s);
> > + ret = request_threaded_irq(s->irq, NULL, sccnxp_ist,
> > + IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> > + dev_name(&pdev->dev), s);
> > if (!ret)
> > return 0;
> >
> > @@ -994,7 +992,7 @@ static int sccnxp_remove(struct platform_device *pdev)
> > struct sccnxp_port *s = platform_get_drvdata(pdev);
> >
> > if (!s->poll)
> > - devm_free_irq(&pdev->dev, s->irq, s);
> > + free_irq(s->irq, s);
>
> Couldn't we just remove the devm_free_irq() and keep using
> devm_request_threaded_irq()?
>
> Like this:
I assumed that if the person went to the trouble of putting it there, it
was because the interrupt handler needs some data that is freed later in
the remove function and interrupts have to be turned off at this point. I
can look into it more though, but the interactions are not always easy to
spot.
julia
>
> --- a/drivers/tty/serial/sccnxp.c
> +++ b/drivers/tty/serial/sccnxp.c
> @@ -993,9 +993,7 @@ static int sccnxp_remove(struct platform_device *pdev)
> int i;
> struct sccnxp_port *s = platform_get_drvdata(pdev);
>
> - if (!s->poll)
> - devm_free_irq(&pdev->dev, s->irq, s);
> - else
> + if (s->poll)
> del_timer_sync(&s->timer);
>
> for (i = 0; i < s->uart.nr; i++)
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-14 18:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-13 13:44 [PATCH] serial: sccnxp: convert devm irq to non devm version Julia Lawall
2015-09-14 16:19 ` Fabio Estevam
2015-09-14 18:45 ` Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®