Skip to content

Commit

Permalink
dmaengine: k3dma: Use devm_platform_ioremap_resource() in k3_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]>
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 1148ac6 commit 3d4d6c2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/dma/k3dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down

0 comments on commit 3d4d6c2

Please sign in to comment.