From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751723AbbINSpd (ORCPT ); Mon, 14 Sep 2015 14:45:33 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:9433 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751017AbbINSpc (ORCPT ); Mon, 14 Sep 2015 14:45:32 -0400 X-IronPort-AV: E=Sophos;i="5.17,530,1437429600"; d="scan'208";a="177492434" Date: Mon, 14 Sep 2015 20:45:29 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Fabio Estevam cc: Julia Lawall , Greg Kroah-Hartman , kernel-janitors@vger.kernel.org, Jiri Slaby , "linux-serial@vger.kernel.org" , linux-kernel Subject: Re: [PATCH] serial: sccnxp: convert devm irq to non devm version In-Reply-To: Message-ID: References: <1442151853-16186-1-git-send-email-Julia.Lawall@lip6.fr> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 Sep 2015, Fabio Estevam wrote: > On Sun, Sep 13, 2015 at 10:44 AM, Julia Lawall 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 >