DMA Engine development
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: Sinan Kaya <okaya@kernel.org>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Vinod Koul <vkoul@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] dmaengine: qcom_hidma: Use devm_platform_get_and_ioremap_resource()
Date: Wed,  5 Jul 2023 16:18:53 +0800	[thread overview]
Message-ID: <20230705081856.13734-2-frank.li@vivo.com> (raw)
In-Reply-To: <20230705081856.13734-1-frank.li@vivo.com>

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/dma/qcom/hidma.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 344525c3a32f..b5e3633e6a5e 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -765,17 +765,15 @@ static int hidma_probe(struct platform_device *pdev)
 	pm_runtime_set_active(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
-	trca_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	trca = devm_ioremap_resource(&pdev->dev, trca_resource);
+	trca = devm_platform_get_and_ioremap_resource(pdev, 0, &trca_resource);
 	if (IS_ERR(trca)) {
-		rc = -ENOMEM;
+		rc = PTR_ERR(trca);
 		goto bailout;
 	}
 
-	evca_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	evca = devm_ioremap_resource(&pdev->dev, evca_resource);
+	evca = devm_platform_get_and_ioremap_resource(pdev, 1, &evca_resource);
 	if (IS_ERR(evca)) {
-		rc = -ENOMEM;
+		rc = PTR_ERR(evca);
 		goto bailout;
 	}
 
@@ -785,7 +783,7 @@ static int hidma_probe(struct platform_device *pdev)
 	 */
 	chirq = platform_get_irq(pdev, 0);
 	if (chirq < 0) {
-		rc = -ENODEV;
+		rc = chirq;
 		goto bailout;
 	}
 
-- 
2.39.0


  reply	other threads:[~2023-07-05  8:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05  8:18 [PATCH 1/5] dmaengine: qcom: gpi: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05  8:18 ` Yangtao Li [this message]
2023-07-05  8:18 ` [PATCH 3/5] dmaengine: qcom: hidma_mgmt: " Yangtao Li
2023-07-05  8:18 ` [PATCH 4/5] dmaengine: shdmac: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-05  8:18 ` [PATCH 5/5] dmaengine: stm32-dma: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06  7:33   ` [Linux-stm32] " Amelie Delaunay
2023-07-11 16:43 ` [PATCH 1/5] dmaengine: qcom: gpi: " Vinod Koul
2023-07-12  9:33   ` Geert Uytterhoeven
2023-07-12 11:30     ` Vinod Koul
2023-07-13  8:00       ` Geert Uytterhoeven
2023-07-13 17:52         ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230705081856.13734-2-frank.li@vivo.com \
    --to=frank.li@vivo.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okaya@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox