From patchwork Wed Feb 9 13:09:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Bedia X-Patchwork-Id: 543921 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p19DCx3W031889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Feb 2011 13:13:20 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p19DBC80010157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Feb 2011 07:11:12 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id p19DBBT3015405; Wed, 9 Feb 2011 07:11:11 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 7977680738; Wed, 9 Feb 2011 07:10:49 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp31.itg.ti.com (dbdp31.itg.ti.com [172.24.170.98]) by linux.omap.com (Postfix) with ESMTP id 53D8980628 for ; Wed, 9 Feb 2011 07:10:02 -0600 (CST) Received: from psplinux052.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p19D9ulm002831; Wed, 9 Feb 2011 18:39:57 +0530 (IST) Received: from psplinux052.india.ti.com (localhost [127.0.0.1]) by psplinux052.india.ti.com (8.13.1/8.13.1) with ESMTP id p19D9u86017192; Wed, 9 Feb 2011 18:39:56 +0530 Received: (from a0393953@localhost) by psplinux052.india.ti.com (8.13.1/8.13.1/Submit) id p19D9ucN017189; Wed, 9 Feb 2011 18:39:56 +0530 From: Vaibhav Bedia To: alsa-devel@alsa-project.org Subject: [PATCH 2/3] ASoC: Davinci: Call clk_disable() and clk_put() in case of error Date: Wed, 9 Feb 2011 18:39:53 +0530 Message-Id: <1297256994-17137-2-git-send-email-vaibhav.bedia@ti.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1297256994-17137-1-git-send-email-vaibhav.bedia@ti.com> References: <1297256994-17137-1-git-send-email-vaibhav.bedia@ti.com> Cc: davinci-linux-open-source@linux.davincidsp.com, broonie@opensource.wolfsonmicro.com, sshtylyov@mvista.com, lrg@slimlogic.co.uk X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 09 Feb 2011 13:13:20 +0000 (UTC) diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index f8c8487..e763d58 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) if (!res) { dev_err(&pdev->dev, "no DMA resource\n"); ret = -ENXIO; - goto err_free_mem; + goto err_release_clk; } dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].channel = res->start; @@ -715,7 +715,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) if (!res) { dev_err(&pdev->dev, "no DMA resource\n"); ret = -ENXIO; - goto err_free_mem; + goto err_release_clk; } dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start; dev->dev = &pdev->dev; @@ -724,10 +724,13 @@ static int davinci_i2s_probe(struct platform_device *pdev) ret = snd_soc_register_dai(&pdev->dev, &davinci_i2s_dai); if (ret != 0) - goto err_free_mem; + goto err_release_clk; return 0; +err_release_clk: + clk_disable(dev->clk); + clk_put(dev->clk); err_free_mem: kfree(dev); err_release_region: diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 9b5d5ca..e7ae621 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: