dmaengine: tegra210-adma: use platform to ioremap
Subsystems (3)
PATCH 1/1 dmaengine: tegra210-adma: use platform to ioremap
Simpler to call the proper function.
Signed-off-by Rosen Penev <[email protected]>
--- drivers/dma/tegra210-adma.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/dma/tegra210-adma.c +3 -8
@@ -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; }
Signature · 1 line
2.52.0
Jon Hunter
maintainerQuoted 1 line · Rosen Penev
Simpler to call the proper function.
We are using a 'proper' function. I think that what you are trying to saying that we can simplify the code by just using devm_platform_ioremap_resource(). Change looks fine, but the commit message and subject could be improved.
Jon
Quoted 28 lines
Signed-off-by Rosen Penev <[email protected]>--- drivers/dma/tegra210-adma.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)drivers/dma/tegra210-adma.c +3
-8@@ -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; }
Signature · 1 line
nvpublic