Commit f1e47b83 authored by Yangtao Li's avatar Yangtao Li Committed by Vinod Koul

dmaengine: qcom_hidma: Use devm_platform_get_and_ioremap_resource()

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: default avatarYangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230705081856.13734-2-frank.li@vivo.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent e93c47a3
...@@ -765,17 +765,15 @@ static int hidma_probe(struct platform_device *pdev) ...@@ -765,17 +765,15 @@ static int hidma_probe(struct platform_device *pdev)
pm_runtime_set_active(&pdev->dev); pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
trca_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); trca = devm_platform_get_and_ioremap_resource(pdev, 0, &trca_resource);
trca = devm_ioremap_resource(&pdev->dev, trca_resource);
if (IS_ERR(trca)) { if (IS_ERR(trca)) {
rc = -ENOMEM; rc = PTR_ERR(trca);
goto bailout; goto bailout;
} }
evca_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1); evca = devm_platform_get_and_ioremap_resource(pdev, 1, &evca_resource);
evca = devm_ioremap_resource(&pdev->dev, evca_resource);
if (IS_ERR(evca)) { if (IS_ERR(evca)) {
rc = -ENOMEM; rc = PTR_ERR(evca);
goto bailout; goto bailout;
} }
...@@ -785,7 +783,7 @@ static int hidma_probe(struct platform_device *pdev) ...@@ -785,7 +783,7 @@ static int hidma_probe(struct platform_device *pdev)
*/ */
chirq = platform_get_irq(pdev, 0); chirq = platform_get_irq(pdev, 0);
if (chirq < 0) { if (chirq < 0) {
rc = -ENODEV; rc = chirq;
goto bailout; goto bailout;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment