aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-09-10 05:14:31 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-10 05:27:05 -0400
commit6ac4262f367fd0d9b0219dfd014ffcca4a6cfa6a (patch)
treec10c511ed5931310aaaee880696f963eabb774be /sound/soc/sh
parentdbd4e51cd164e7d94b00c0c0dd3ac5517364a8fb (diff)
ASoC: fsi: convert to devm_xxx()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/fsi.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index a5ee2faa1073..5328ae5539f1 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1655,22 +1655,20 @@ static int fsi_probe(struct platform_device *pdev)
1655 irq = platform_get_irq(pdev, 0); 1655 irq = platform_get_irq(pdev, 0);
1656 if (!res || (int)irq <= 0) { 1656 if (!res || (int)irq <= 0) {
1657 dev_err(&pdev->dev, "Not enough FSI platform resources.\n"); 1657 dev_err(&pdev->dev, "Not enough FSI platform resources.\n");
1658 ret = -ENODEV; 1658 return -ENODEV;
1659 goto exit;
1660 } 1659 }
1661 1660
1662 master = kzalloc(sizeof(*master), GFP_KERNEL); 1661 master = devm_kzalloc(&pdev->dev, sizeof(*master), GFP_KERNEL);
1663 if (!master) { 1662 if (!master) {
1664 dev_err(&pdev->dev, "Could not allocate master\n"); 1663 dev_err(&pdev->dev, "Could not allocate master\n");
1665 ret = -ENOMEM; 1664 return -ENOMEM;
1666 goto exit;
1667 } 1665 }
1668 1666
1669 master->base = ioremap_nocache(res->start, resource_size(res)); 1667 master->base = devm_ioremap_nocache(&pdev->dev,
1668 res->start, resource_size(res));
1670 if (!master->base) { 1669 if (!master->base) {
1671 ret = -ENXIO;
1672 dev_err(&pdev->dev, "Unable to ioremap FSI registers.\n"); 1670 dev_err(&pdev->dev, "Unable to ioremap FSI registers.\n");
1673 goto exit_kfree; 1671 return -ENXIO;
1674 } 1672 }
1675 1673
1676 /* master setting */ 1674 /* master setting */
@@ -1686,7 +1684,7 @@ static int fsi_probe(struct platform_device *pdev)
1686 ret = fsi_stream_probe(&master->fsia, &pdev->dev); 1684 ret = fsi_stream_probe(&master->fsia, &pdev->dev);
1687 if (ret < 0) { 1685 if (ret < 0) {
1688 dev_err(&pdev->dev, "FSIA stream probe failed\n"); 1686 dev_err(&pdev->dev, "FSIA stream probe failed\n");
1689 goto exit_iounmap; 1687 return ret;
1690 } 1688 }
1691 1689
1692 /* FSI B setting */ 1690 /* FSI B setting */
@@ -1734,11 +1732,7 @@ exit_fsib:
1734 fsi_stream_remove(&master->fsib); 1732 fsi_stream_remove(&master->fsib);
1735exit_fsia: 1733exit_fsia:
1736 fsi_stream_remove(&master->fsia); 1734 fsi_stream_remove(&master->fsia);
1737exit_iounmap: 1735
1738 iounmap(master->base);
1739exit_kfree:
1740 kfree(master);
1741exit:
1742 return ret; 1736 return ret;
1743} 1737}
1744 1738
@@ -1757,9 +1751,6 @@ static int fsi_remove(struct platform_device *pdev)
1757 fsi_stream_remove(&master->fsia); 1751 fsi_stream_remove(&master->fsia);
1758 fsi_stream_remove(&master->fsib); 1752 fsi_stream_remove(&master->fsib);
1759 1753
1760 iounmap(master->base);
1761 kfree(master);
1762
1763 return 0; 1754 return 0;
1764} 1755}
1765 1756