lkml.org 
[lkml]   [2015]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    SubjectRe: [PATCH] serial: sccnxp: convert devm irq to non devm version
    From
    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++)

    \
     
     \ /
      Last update: 2015-09-14 18:41    [W:3.282 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site