Skip to content

Commit

Permalink
dmaengine: zx: Use devm_platform_ioremap_resource() in zx_dma_probe()
Browse files Browse the repository at this point in the history
Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
elfring authored and vinodkoul committed Oct 14, 2019
1 parent ecb4d34 commit 833b482
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/dma/zx_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 833b482

Please sign in to comment.