From patchwork Wed Apr 24 09:21:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien DESSENNE X-Patchwork-Id: 10914347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 952F81515 for ; Wed, 24 Apr 2019 09:22:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84D9E289B3 for ; Wed, 24 Apr 2019 09:22:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78DA1289B8; Wed, 24 Apr 2019 09:22:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82FBB289B3 for ; Wed, 24 Apr 2019 09:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=0qS7L2Ztx7St+S1ZxTZJ8VJwPLxQTwBr0bgRK/iYPG0=; b=jsb/fnexpeTcSa RRjm4PheYoj90s4TS9Uv22rjtMaKI5eL18sivVOAkBYj0xORjTQFkqz6B2Z7KBNx+oIa2vw1RD4V9 SS79lCLdwVFSnMDZxVvpgDiRc/INbQL7Bzqwtuh3U7xM0fd2rFpgEP/thbctftKaU7fblMhGgjMs6 gXPAYYz2UZQHomvONpioyY4iflWCr7nhLTohSfTX5AzyHAxIFNdmYKPPspt/8bKXn4iUbq8Q9ZHN1 3+HQA9ZILuUCyAxUgncnducuk+K6H0gTjdbKZi+bX+WRpSJo4CE85MoyQ27qeq0qvWjS2YaISn99G liS6zUdtwnUcSQxBYVRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJE6J-0001ng-NO; Wed, 24 Apr 2019 09:21:59 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJE6F-0001nK-Q2 for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 09:21:57 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3O9HQaJ030753; Wed, 24 Apr 2019 11:21:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=YUB6Zr4mQO1vo7mjsN1l9v+q+hPoYBype2WkI1xrxao=; b=luX2JALB3WHOeeP5YCpHnvsVvg4WlmXv1n8RpabTse8TQHjNSX5hV72EZ4eMKOyGQfGt BUyA8J6xq2++b/AdW54fFoM/ZL49MEALoyaTlXbxF1vZJj6SSw42GgM0Kib8Xl00v/X4 jOYsSiGb3yg4OL9KKiwARQKz1Lr8eMTDBs+erxIsyWyChqEbMxmqTkO3LmnhbvqT+sVr hhRw0/an189QX7EFvZ7Kp0DyWZ1CtD5rHtpyXnELojyO6zoq8GOBo1O72mVniuTgtqPP oM1sjH/q/V9Z3q9dHLyDZTH+THJPlnUjwlnYGjEuOqjoBgrSaFyLZ/x6tofRXp/i43yi vg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2rytad5hba-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 Apr 2019 11:21:45 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AA73234; Wed, 24 Apr 2019 09:21:44 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 839981559; Wed, 24 Apr 2019 09:21:44 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 24 Apr 2019 11:21:44 +0200 Received: from localhost (10.201.23.25) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 11:21:43 +0200 From: Fabien Dessenne To: Vinod Koul , Dan Williams , Maxime Coquelin , Alexandre Torgue , Pierre-Yves MORDRET , , , , Subject: [PATCH] dmaengine: stm32-dma: dmaengine: stm32-dma: use platform_get_irq() Date: Wed, 24 Apr 2019 11:21:25 +0200 Message-ID: <1556097685-7236-1-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.201.23.25] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-24_07:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_022156_181492_4D22B373 X-CRM114-Status: GOOD ( 14.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabien Dessenne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP platform_get_resource(pdev, IORESOURCE_IRQ) is not recommended for requesting IRQ's resources, as they can be not ready yet. Using platform_get_irq() instead is preferred for getting IRQ even if it was not retrieved earlier. Signed-off-by: Fabien Dessenne Reviewed-by: Pierre-Yves MORDRET --- drivers/dma/stm32-dma.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index ba239b5..3306818 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -1302,13 +1302,14 @@ static int stm32_dma_probe(struct platform_device *pdev) for (i = 0; i < STM32_DMA_MAX_CHANNELS; i++) { chan = &dmadev->chan[i]; - res = platform_get_resource(pdev, IORESOURCE_IRQ, i); - if (!res) { - ret = -EINVAL; - dev_err(&pdev->dev, "No irq resource for chan %d\n", i); + chan->irq = platform_get_irq(pdev, i); + if (chan->irq < 0) { + ret = chan->irq; + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, + "No irq resource for chan %d\n", i); goto err_unregister; } - chan->irq = res->start; ret = devm_request_irq(&pdev->dev, chan->irq, stm32_dma_chan_irq, 0, dev_name(chan2dev(chan)), chan);