Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1224291

Re: [PATCH] serial: sccnxp: convert devm irq to non devm version

From Fabio Estevam <festevam@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] serial: sccnxp: convert devm irq to non devm version
Date 2015-09-14 18:20 +0200
Message-ID <q8EE2-2St-17@gated-at.bofh.it> (permalink)
References <q8fYZ-ZJ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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++)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] serial: sccnxp: convert devm irq to non devm version Julia Lawall <Julia.Lawall@lip6.fr> - 2015-09-13 16:00 +0200
  Re: [PATCH] serial: sccnxp: convert devm irq to non devm version Fabio Estevam <festevam@gmail.com> - 2015-09-14 18:20 +0200
    Re: [PATCH] serial: sccnxp: convert devm irq to non devm version Julia Lawall <julia.lawall@lip6.fr> - 2015-09-14 20:50 +0200

csiph-web