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 3/5] dmaengine: qcom: hidma_mgmt: Use devm_platform_get_and_ioremap_resource()
Date: Wed,  5 Jul 2023 16:18:54 +0800	[thread overview]
Message-ID: <20230705081856.13734-3-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_mgmt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/qcom/hidma_mgmt.c b/drivers/dma/qcom/hidma_mgmt.c
index 05e96b31d871..1d675f31252b 100644
--- a/drivers/dma/qcom/hidma_mgmt.c
+++ b/drivers/dma/qcom/hidma_mgmt.c
@@ -176,10 +176,9 @@ static int hidma_mgmt_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_get_sync(&pdev->dev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	virtaddr = devm_ioremap_resource(&pdev->dev, res);
+	virtaddr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(virtaddr)) {
-		rc = -ENOMEM;
+		rc = PTR_ERR(virtaddr);
 		goto out;
 	}
 
-- 
2.39.0


  parent reply	other threads:[~2023-07-05  8:21 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 ` [PATCH 2/5] dmaengine: qcom_hidma: " Yangtao Li
2023-07-05  8:18 ` Yangtao Li [this message]
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-3-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