summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/soc/fsl/mpc5200_dma.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
index ee4fb5c932ca..56e2cf2f727b 100644
--- a/sound/soc/fsl/mpc5200_dma.c
+++ b/sound/soc/fsl/mpc5200_dma.c
@@ -326,7 +326,7 @@ int mpc5200_audio_dma_create(struct platform_device *op)
dev_err(&op->dev, "Missing reg property\n");
return -ENODEV;
}
- regs = ioremap(res.start, resource_size(&res));
+ regs = devm_ioremap(&op->dev, res.start, resource_size(&res));
if (!regs) {
dev_err(&op->dev, "Could not map registers\n");
return -ENODEV;
@@ -334,10 +334,8 @@ int mpc5200_audio_dma_create(struct platform_device *op)
/* Allocate and initialize the driver private data */
psc_dma = kzalloc_obj(*psc_dma);
- if (!psc_dma) {
- ret = -ENOMEM;
- goto out_unmap;
- }
+ if (!psc_dma)
+ return -ENOMEM;
/* Get the PSC ID */
prop = of_get_property(op->dev.of_node, "cell-index", &size);
@@ -424,8 +422,6 @@ out_irq:
free_irq(psc_dma->playback.irq, &psc_dma->playback);
out_free:
kfree(psc_dma);
-out_unmap:
- iounmap(regs);
return ret;
}
EXPORT_SYMBOL_GPL(mpc5200_audio_dma_create);
@@ -444,7 +440,6 @@ int mpc5200_audio_dma_destroy(struct platform_device *op)
free_irq(psc_dma->capture.irq, &psc_dma->capture);
free_irq(psc_dma->playback.irq, &psc_dma->playback);
- iounmap(psc_dma->psc_regs);
kfree(psc_dma);
dev_set_drvdata(&op->dev, NULL);