summaryrefslogtreecommitdiffstats
path: root/drivers/dma/zx_dma.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-09-22 14:32:12 +0200
committerVinod Koul <vkoul@kernel.org>2019-10-14 13:21:21 +0530
commit833b48242686606670edaa72a465c0faa44d2916 (patch)
treeafaf96a8f75af6b39d59475ef94904749cf7c75b /drivers/dma/zx_dma.c
parentecb4d34fafec4fea6fe218f25cc390775a609efd (diff)
downloadlinux-833b48242686606670edaa72a465c0faa44d2916.tar.bz2
dmaengine: zx: Use devm_platform_ioremap_resource() in zx_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> Acked-by: Shawn Guo <shawnguo@kernel.org> Link: https://lore.kernel.org/r/85de79fa-1ca5-a1e5-0296-9e8a2066f134@web.de Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/zx_dma.c')
-rw-r--r--drivers/dma/zx_dma.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c
index 9f4436f7c914..6b457e683e70 100644
--- a/drivers/dma/zx_dma.c
+++ b/drivers/dma/zx_dma.c
@@ -754,18 +754,13 @@ static struct dma_chan *zx_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
static int zx_dma_probe(struct platform_device *op)
{
struct zx_dma_dev *d;
- struct resource *iores;
int i, ret = 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;
- 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);