summaryrefslogtreecommitdiff
path: root/sound/soc/davinci/davinci-mcasp.c
diff options
context:
space:
mode:
authorVaibhav Bedia <vaibhav.bedia@ti.com>2011-02-09 18:39:53 +0530
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-09 22:33:16 +0000
commiteef6d7b8c24e8dd5af6094ef453a05c80b68d36e (patch)
tree77a1690881491f6b256ee6fb93d20b466720cce8 /sound/soc/davinci/davinci-mcasp.c
parentd852f446b71b80c59821a08cdb595aa266210daf (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/davinci-mcasp.c')
-rw-r--r--sound/soc/davinci/davinci-mcasp.c9
1 files changed, 6 insertions, 3 deletions
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)
if (!res) {
dev_err(&pdev->dev, "no DMA resource\n");
ret = -ENODEV;
- goto err_release_region;
+ goto err_release_clk;
}
dma_data->channel = res->start;
@@ -921,7 +921,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
if (!res) {
dev_err(&pdev->dev, "no DMA resource\n");
ret = -ENODEV;
- goto err_release_region;
+ goto err_release_clk;
}
dma_data->channel = res->start;
@@ -929,9 +929,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]);
if (ret != 0)
- goto err_release_region;
+ goto err_release_clk;
return 0;
+err_release_clk:
+ clk_disable(dev->clk);
+ clk_put(dev->clk);
err_release_region:
release_mem_region(mem->start, resource_size(mem));
err_release_data: