From patchwork Mon Dec 1 20:40:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5415321 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E9A1E9F30B for ; Mon, 1 Dec 2014 20:41:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 181D220263 for ; Mon, 1 Dec 2014 20:41:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DC3722025A for ; Mon, 1 Dec 2014 20:41:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3F0F826070A; Mon, 1 Dec 2014 21:41:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 0BA562606F7; Mon, 1 Dec 2014 21:41:01 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D71892606FD; Mon, 1 Dec 2014 21:40:59 +0100 (CET) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by alsa0.perex.cz (Postfix) with ESMTP id A3D422606EB for ; Mon, 1 Dec 2014 21:40:51 +0100 (CET) Received: by mail-la0-f45.google.com with SMTP id gq15so9410951lab.4 for ; Mon, 01 Dec 2014 12:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HaAJJZfigcgDsk631njil1eqqOayh9mxma/E82vdEb8=; b=yKlxiW9Hc4hB8EfhnQW98ZGVMzNKx0SPxNUPsKQp1zu4K/wNa7smKEhGJlCjpdq4Wq snp4fTXSWQsl2P7T8N1/zK1jn29d8FfOHbT1jenVi+04xu7qm7+AJ55ufkYNUR49JfVW COzqulCEiDFvSm9srSJfgWQswasuah0aRs45EtAquFJXMU5jjonfCOpaomSsddi7Tew8 KRylC55BHsry3JeIsJtYJvhPhWLpir14CLJiYfCkr208JdxcDIsIs6diBxNJuU3jvNSg nRZjzKXQvmLtptCIyvMO5vOVP9H3YxDD9Q7NSPiCf3pBBKju4d4LAI7Fg92maXXhkBiY iMsg== MIME-Version: 1.0 X-Received: by 10.112.63.133 with SMTP id g5mr58539265lbs.33.1417466451175; Mon, 01 Dec 2014 12:40:51 -0800 (PST) Received: by 10.152.22.229 with HTTP; Mon, 1 Dec 2014 12:40:51 -0800 (PST) In-Reply-To: <547CCFF7.2000205@metafoo.de> References: <1417402251-6596-1-git-send-email-jiada_wang@mentor.com> <2547588.Qc4F2IfZke@wuerfel> <547CC89F.1030205@tabi.org> <3401240.VsRpsiV8WN@wuerfel> <547CCB78.5090007@tabi.org> <547CCFF7.2000205@metafoo.de> Date: Mon, 1 Dec 2014 18:40:51 -0200 Message-ID: From: Fabio Estevam To: Lars-Peter Clausen Cc: "alsa-devel@alsa-project.org" , Arnd Bergmann , Liam Girdwood , Jiada Wang , Mark Brown , Timur Tabi , linux-kernel , Nicolin Chen , Takashi Iwai , Xiubo Li , Markus Pargmann , "linuxppc-dev@lists.ozlabs.org" Subject: Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Dec 1, 2014 at 6:30 PM, Lars-Peter Clausen wrote: > On 12/01/2014 09:11 PM, Timur Tabi wrote: >> >> On 12/01/2014 02:01 PM, Arnd Bergmann wrote: >>>> >>>> >Does this mean that fsl_ssi.c should not be calling >>>> >irq_of_parse_and_map? How else should it get the IRQ? >>> >>> platform_get_irq() >> >> >> Ok, but that function also calls irq_create_of_mapping(). So it still >> appears that the only way to get the IRQ is to map it, but then we can't >> use >> devm_request_irq(). >> > > Hm... that's new. But it's not really a driver issue anymore if it is done > in the core. So I guess for now just use platform_get_irq() and ignore the > other issue. With the suggested changes below, the removal of the driver works fine on a mx6: root@freescale /$ modprobe snd-soc-fsl-ssi root@freescale /$ modprobe snd-soc-imx-wm8962 [ 319.517679] input: WM8962 Beep Generator as /devices/soc0/soc/2100000.aips-bus/21a0000.i2c/i2c-0/0-001a/input/input7 [ 319.543225] imx-wm8962 sound: wm8962 <-> 202c000.ssi mapping ok root@freescale /$ rmmod snd-soc-imx-wm8962 root@freescale /$ rmmod snd-soc-fsl-ssi sound/soc/fsl/fsl_ssi.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 32a31d9..c528f16 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1361,7 +1361,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) return PTR_ERR(ssi_private->regs); } - ssi_private->irq = irq_of_parse_and_map(np, 0); + ssi_private->irq = platform_get_irq(pdev, 0); if (!ssi_private->irq) { dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); return -ENXIO; @@ -1387,7 +1387,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) if (ssi_private->soc->imx) { ret = fsl_ssi_imx_probe(pdev, ssi_private, iomem); if (ret) - goto error_irqmap; + return ret; } ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component, @@ -1458,10 +1458,6 @@ error_asoc_register: if (ssi_private->soc->imx) fsl_ssi_imx_clean(pdev, ssi_private); -error_irqmap: - if (ssi_private->use_dma) - irq_dispose_mapping(ssi_private->irq); - return ret; } @@ -1478,9 +1474,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) if (ssi_private->soc->imx) fsl_ssi_imx_clean(pdev, ssi_private); - if (ssi_private->use_dma) - irq_dispose_mapping(ssi_private->irq); - return 0; }