diff options
author | Vaibhav Bedia <vaibhav.bedia@ti.com> | 2011-02-09 08:09:53 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-02-09 17:33:16 -0500 |
commit | eef6d7b8c24e8dd5af6094ef453a05c80b68d36e (patch) | |
tree | 77a1690881491f6b256ee6fb93d20b466720cce8 /sound/soc/davinci | |
parent | d852f446b71b80c59821a08cdb595aa266210daf (diff) |
ASoC: Davinci: Call clk_disable() and clk_put() in case of error
In case of any error in probe() function, clk_disable() and clk_put()
should be called if clk_enable() and clk_get() went through.
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r-- | sound/soc/davinci/davinci-i2s.c | 9 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index f8c8487aba55..e763d58e51f8 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c | |||
@@ -707,7 +707,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
707 | if (!res) { | 707 | if (!res) { |
708 | dev_err(&pdev->dev, "no DMA resource\n"); | 708 | dev_err(&pdev->dev, "no DMA resource\n"); |
709 | ret = -ENXIO; | 709 | ret = -ENXIO; |
710 | goto err_free_mem; | 710 | goto err_release_clk; |
711 | } | 711 | } |
712 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].channel = res->start; | 712 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].channel = res->start; |
713 | 713 | ||
@@ -715,7 +715,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
715 | if (!res) { | 715 | if (!res) { |
716 | dev_err(&pdev->dev, "no DMA resource\n"); | 716 | dev_err(&pdev->dev, "no DMA resource\n"); |
717 | ret = -ENXIO; | 717 | ret = -ENXIO; |
718 | goto err_free_mem; | 718 | goto err_release_clk; |
719 | } | 719 | } |
720 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start; | 720 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start; |
721 | dev->dev = &pdev->dev; | 721 | dev->dev = &pdev->dev; |
@@ -724,10 +724,13 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
724 | 724 | ||
725 | ret = snd_soc_register_dai(&pdev->dev, &davinci_i2s_dai); | 725 | ret = snd_soc_register_dai(&pdev->dev, &davinci_i2s_dai); |
726 | if (ret != 0) | 726 | if (ret != 0) |
727 | goto err_free_mem; | 727 | goto err_release_clk; |
728 | 728 | ||
729 | return 0; | 729 | return 0; |
730 | 730 | ||
731 | err_release_clk: | ||
732 | clk_disable(dev->clk); | ||
733 | clk_put(dev->clk); | ||
731 | err_free_mem: | 734 | err_free_mem: |
732 | kfree(dev); | 735 | kfree(dev); |
733 | err_release_region: | 736 | err_release_region: |
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 9b5d5ca37a97..e7ae621a3afa 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -906,7 +906,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
906 | if (!res) { | 906 | if (!res) { |
907 | dev_err(&pdev->dev, "no DMA resource\n"); | 907 | dev_err(&pdev->dev, "no DMA resource\n"); |
908 | ret = -ENODEV; | 908 | ret = -ENODEV; |
909 | goto err_release_region; | 909 | goto err_release_clk; |
910 | } | 910 | } |
911 | 911 | ||
912 | dma_data->channel = res->start; | 912 | dma_data->channel = res->start; |
@@ -921,7 +921,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
921 | if (!res) { | 921 | if (!res) { |
922 | dev_err(&pdev->dev, "no DMA resource\n"); | 922 | dev_err(&pdev->dev, "no DMA resource\n"); |
923 | ret = -ENODEV; | 923 | ret = -ENODEV; |
924 | goto err_release_region; | 924 | goto err_release_clk; |
925 | } | 925 | } |
926 | 926 | ||
927 | dma_data->channel = res->start; | 927 | dma_data->channel = res->start; |
@@ -929,9 +929,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
929 | ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]); | 929 | ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]); |
930 | 930 | ||
931 | if (ret != 0) | 931 | if (ret != 0) |
932 | goto err_release_region; | 932 | goto err_release_clk; |
933 | return 0; | 933 | return 0; |
934 | 934 | ||
935 | err_release_clk: | ||
936 | clk_disable(dev->clk); | ||
937 | clk_put(dev->clk); | ||
935 | err_release_region: | 938 | err_release_region: |
936 | release_mem_region(mem->start, resource_size(mem)); | 939 | release_mem_region(mem->start, resource_size(mem)); |
937 | err_release_data: | 940 | err_release_data: |