diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2022-11-10 16:25:28 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-01-18 17:46:47 +0100 |
commit | 4b23603a251d24022f2fa48ee67610eb245a4115 (patch) | |
tree | 86453ac92d58c7e8946f800f8d1bf9d94ee0e12b /drivers/dma/ti | |
parent | dmaengine: at_xdmac: remove empty line (diff) | |
download | linux-4b23603a251d24022f2fa48ee67610eb245a4115.tar.xz linux-4b23603a251d24022f2fa48ee67610eb245a4115.zip |
dmaengine: drivers: Use devm_platform_ioremap_resource()
platform_get_resource() and devm_ioremap_resource() are wrapped up in the
devm_platform_ioremap_resource() helper. Use the helper and get rid of the
local variable for struct resource *. We now have a function call less.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20221110152528.7821-1-tudor.ambarus@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/ti')
-rw-r--r-- | drivers/dma/ti/cppi41.c | 10 | ||||
-rw-r--r-- | drivers/dma/ti/omap-dma.c | 4 |
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c index 695915dba707..c3555cfb0681 100644 --- a/drivers/dma/ti/cppi41.c +++ b/drivers/dma/ti/cppi41.c @@ -1039,7 +1039,6 @@ static int cppi41_dma_probe(struct platform_device *pdev) struct cppi41_dd *cdd; struct device *dev = &pdev->dev; const struct cppi_glue_infos *glue_info; - struct resource *mem; int index; int irq; int ret; @@ -1072,18 +1071,15 @@ static int cppi41_dma_probe(struct platform_device *pdev) if (index < 0) return index; - mem = platform_get_resource(pdev, IORESOURCE_MEM, index); - cdd->ctrl_mem = devm_ioremap_resource(dev, mem); + cdd->ctrl_mem = devm_platform_ioremap_resource(pdev, index); if (IS_ERR(cdd->ctrl_mem)) return PTR_ERR(cdd->ctrl_mem); - mem = platform_get_resource(pdev, IORESOURCE_MEM, index + 1); - cdd->sched_mem = devm_ioremap_resource(dev, mem); + cdd->sched_mem = devm_platform_ioremap_resource(pdev, index + 1); if (IS_ERR(cdd->sched_mem)) return PTR_ERR(cdd->sched_mem); - mem = platform_get_resource(pdev, IORESOURCE_MEM, index + 2); - cdd->qmgr_mem = devm_ioremap_resource(dev, mem); + cdd->qmgr_mem = devm_platform_ioremap_resource(pdev, index + 2); if (IS_ERR(cdd->qmgr_mem)) return PTR_ERR(cdd->qmgr_mem); diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c index 27f5019bdc1e..02e1c08c596d 100644 --- a/drivers/dma/ti/omap-dma.c +++ b/drivers/dma/ti/omap-dma.c @@ -1658,7 +1658,6 @@ static int omap_dma_probe(struct platform_device *pdev) { const struct omap_dma_config *conf; struct omap_dmadev *od; - struct resource *res; int rc, i, irq; u32 val; @@ -1666,8 +1665,7 @@ static int omap_dma_probe(struct platform_device *pdev) if (!od) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - od->base = devm_ioremap_resource(&pdev->dev, res); + od->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(od->base)) return PTR_ERR(od->base); |