public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3] dmaengine: tegra210-adma: use devm_platform_ioremap_resource
@ 2026-02-02  3:44 Rosen Penev
  2026-02-02 16:46 ` Frank Li
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-02-02  3:44 UTC (permalink / raw)
  To: dmaengine
  Cc: Laxman Dewangan, Jon Hunter, Vinod Koul, Thierry Reding,
	open list:TEGRA ARCHITECTURE SUPPORT, open list

Simpler to call the proper function.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 v3: reword title
 v2: reword commit message
 drivers/dma/tegra210-adma.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index 215bfef37ec6..5353fbb3d995 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -1073,14 +1073,9 @@ static int tegra_adma_probe(struct platform_device *pdev)
 		}
 	} else {
 		/* If no 'page' property found, then reg DT binding would be legacy */
-		res_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		if (res_base) {
-			tdma->base_addr = devm_ioremap_resource(&pdev->dev, res_base);
-			if (IS_ERR(tdma->base_addr))
-				return PTR_ERR(tdma->base_addr);
-		} else {
-			return -ENODEV;
-		}
+		tdma->base_addr = devm_platform_ioremap_resource(pdev, 0);
+		if (IS_ERR(tdma->base_addr))
+			return PTR_ERR(tdma->base_addr);

 		tdma->ch_base_addr = tdma->base_addr + cdata->ch_base_offset;
 	}
--
2.52.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv3] dmaengine: tegra210-adma: use devm_platform_ioremap_resource
  2026-02-02  3:44 [PATCHv3] dmaengine: tegra210-adma: use devm_platform_ioremap_resource Rosen Penev
@ 2026-02-02 16:46 ` Frank Li
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-02-02 16:46 UTC (permalink / raw)
  To: Rosen Penev
  Cc: dmaengine, Laxman Dewangan, Jon Hunter, Vinod Koul,
	Thierry Reding, open list:TEGRA ARCHITECTURE SUPPORT, open list

On Sun, Feb 01, 2026 at 07:44:19PM -0800, Rosen Penev wrote:
> Simpler to call the proper function.

subject: function name need ()

dmaengine: tegra210-adma: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify code.

No funcational change.

Frank
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
>  v3: reword title
>  v2: reword commit message
>  drivers/dma/tegra210-adma.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
> index 215bfef37ec6..5353fbb3d995 100644
> --- a/drivers/dma/tegra210-adma.c
> +++ b/drivers/dma/tegra210-adma.c
> @@ -1073,14 +1073,9 @@ static int tegra_adma_probe(struct platform_device *pdev)
>  		}
>  	} else {
>  		/* If no 'page' property found, then reg DT binding would be legacy */
> -		res_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -		if (res_base) {
> -			tdma->base_addr = devm_ioremap_resource(&pdev->dev, res_base);
> -			if (IS_ERR(tdma->base_addr))
> -				return PTR_ERR(tdma->base_addr);
> -		} else {
> -			return -ENODEV;
> -		}
> +		tdma->base_addr = devm_platform_ioremap_resource(pdev, 0);
> +		if (IS_ERR(tdma->base_addr))
> +			return PTR_ERR(tdma->base_addr);
>
>  		tdma->ch_base_addr = tdma->base_addr + cdata->ch_base_offset;
>  	}
> --
> 2.52.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-02 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02  3:44 [PATCHv3] dmaengine: tegra210-adma: use devm_platform_ioremap_resource Rosen Penev
2026-02-02 16:46 ` Frank Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox