diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-25 12:17:24 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-25 12:17:24 +0100 |
commit | 2c54c1586c78775cfdfb071e68b27e14b668921f (patch) | |
tree | cf57390a0b82d2bd1ade5e5356434c66c39af38a /sound/soc/imx/imx-ssi.c | |
parent | ASoC: smdk_wm9713: fix resource leak in smdk_init error path (diff) | |
parent | ASoC: davinci-vcif - fix a memory leak (diff) | |
download | linux-2c54c1586c78775cfdfb071e68b27e14b668921f.tar.xz linux-2c54c1586c78775cfdfb071e68b27e14b668921f.zip |
Merge branch 'for-2.6.37' into for-2.6.38
Diffstat (limited to 'sound/soc/imx/imx-ssi.c')
-rw-r--r-- | sound/soc/imx/imx-ssi.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index ad21f814e6a1..30894ea7f333 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c @@ -679,8 +679,11 @@ static int imx_ssi_probe(struct platform_device *pdev) } ssi->soc_platform_pdev_fiq = platform_device_alloc("imx-fiq-pcm-audio", pdev->id); - if (!ssi->soc_platform_pdev_fiq) + if (!ssi->soc_platform_pdev_fiq) { + ret = -ENOMEM; goto failed_pdev_fiq_alloc; + } + platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi); ret = platform_device_add(ssi->soc_platform_pdev_fiq); if (ret) { @@ -689,8 +692,11 @@ static int imx_ssi_probe(struct platform_device *pdev) } ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); - if (!ssi->soc_platform_pdev) + if (!ssi->soc_platform_pdev) { + ret = -ENOMEM; goto failed_pdev_alloc; + } + platform_set_drvdata(ssi->soc_platform_pdev, ssi); ret = platform_device_add(ssi->soc_platform_pdev); if (ret) { @@ -703,6 +709,7 @@ static int imx_ssi_probe(struct platform_device *pdev) failed_pdev_add: platform_device_put(ssi->soc_platform_pdev); failed_pdev_alloc: + platform_device_del(ssi->soc_platform_pdev_fiq); failed_pdev_fiq_add: platform_device_put(ssi->soc_platform_pdev_fiq); failed_pdev_fiq_alloc: @@ -726,8 +733,8 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev) struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct imx_ssi *ssi = platform_get_drvdata(pdev); - platform_device_del(ssi->soc_platform_pdev); - platform_device_put(ssi->soc_platform_pdev); + platform_device_unregister(ssi->soc_platform_pdev); + platform_device_unregister(ssi->soc_platform_pdev_fiq); snd_soc_unregister_dai(&pdev->dev); |