aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-09-22 11:36:18 +0200
committerVinod Koul <vkoul@kernel.org>2019-10-14 13:21:20 +0530
commit3d4d6c27f65cbcfc8293cc08eae257e1d90aef48 (patch)
tree67ac23dab43fd315df1c867f5db640504643e0e6 /drivers/dma
parentdmaengine: jz4780: Use devm_platform_ioremap_resource() in jz4780_dma_probe() (diff)
downloadlinux-dev-3d4d6c27f65cbcfc8293cc08eae257e1d90aef48.tar.xz
linux-dev-3d4d6c27f65cbcfc8293cc08eae257e1d90aef48.zip
dmaengine: k3dma: Use devm_platform_ioremap_resource() in k3_dma_probe()
Simplify this function implementation by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Link: https://lore.kernel.org/r/aaed7862-49bb-e368-3e7b-5cc2c3d915b1@web.de Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/k3dma.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index 4b36c8810517..adecea51814f 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -835,13 +835,8 @@ static int k3_dma_probe(struct platform_device *op)
const struct k3dma_soc_data *soc_data;
struct k3_dma_dev *d;
const struct of_device_id *of_id;
- struct resource *iores;
int i, ret, irq = 0;
- iores = platform_get_resource(op, IORESOURCE_MEM, 0);
- if (!iores)
- return -EINVAL;
-
d = devm_kzalloc(&op->dev, sizeof(*d), GFP_KERNEL);
if (!d)
return -ENOMEM;
@@ -850,7 +845,7 @@ static int k3_dma_probe(struct platform_device *op)
if (!soc_data)
return -EINVAL;
- d->base = devm_ioremap_resource(&op->dev, iores);
+ d->base = devm_platform_ioremap_resource(op, 0);
if (IS_ERR(d->base))
return PTR_ERR(d->base);