Commit 6ac4262f authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: fsi: convert to devm_xxx()

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent dbd4e51c
...@@ -1655,22 +1655,20 @@ static int fsi_probe(struct platform_device *pdev) ...@@ -1655,22 +1655,20 @@ static int fsi_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (!res || (int)irq <= 0) { if (!res || (int)irq <= 0) {
dev_err(&pdev->dev, "Not enough FSI platform resources.\n"); dev_err(&pdev->dev, "Not enough FSI platform resources.\n");
ret = -ENODEV; return -ENODEV;
goto exit;
} }
master = kzalloc(sizeof(*master), GFP_KERNEL); master = devm_kzalloc(&pdev->dev, sizeof(*master), GFP_KERNEL);
if (!master) { if (!master) {
dev_err(&pdev->dev, "Could not allocate master\n"); dev_err(&pdev->dev, "Could not allocate master\n");
ret = -ENOMEM; return -ENOMEM;
goto exit;
} }
master->base = ioremap_nocache(res->start, resource_size(res)); master->base = devm_ioremap_nocache(&pdev->dev,
res->start, resource_size(res));
if (!master->base) { if (!master->base) {
ret = -ENXIO;
dev_err(&pdev->dev, "Unable to ioremap FSI registers.\n"); dev_err(&pdev->dev, "Unable to ioremap FSI registers.\n");
goto exit_kfree; return -ENXIO;
} }
/* master setting */ /* master setting */
...@@ -1686,7 +1684,7 @@ static int fsi_probe(struct platform_device *pdev) ...@@ -1686,7 +1684,7 @@ static int fsi_probe(struct platform_device *pdev)
ret = fsi_stream_probe(&master->fsia, &pdev->dev); ret = fsi_stream_probe(&master->fsia, &pdev->dev);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "FSIA stream probe failed\n"); dev_err(&pdev->dev, "FSIA stream probe failed\n");
goto exit_iounmap; return ret;
} }
/* FSI B setting */ /* FSI B setting */
...@@ -1734,11 +1732,7 @@ static int fsi_probe(struct platform_device *pdev) ...@@ -1734,11 +1732,7 @@ static int fsi_probe(struct platform_device *pdev)
fsi_stream_remove(&master->fsib); fsi_stream_remove(&master->fsib);
exit_fsia: exit_fsia:
fsi_stream_remove(&master->fsia); fsi_stream_remove(&master->fsia);
exit_iounmap:
iounmap(master->base);
exit_kfree:
kfree(master);
exit:
return ret; return ret;
} }
...@@ -1757,9 +1751,6 @@ static int fsi_remove(struct platform_device *pdev) ...@@ -1757,9 +1751,6 @@ static int fsi_remove(struct platform_device *pdev)
fsi_stream_remove(&master->fsia); fsi_stream_remove(&master->fsia);
fsi_stream_remove(&master->fsib); fsi_stream_remove(&master->fsib);
iounmap(master->base);
kfree(master);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment