diff mbox

ASoC: davinvi-mcasp: Balance pm_runtime_enable() on probe failure

Message ID 1415537114-9642-1-git-send-email-anilk4.v@gmail.com (mailing list archive)
State Accepted
Commit 7771ef3286711a121b763c3620c4619f51b2acfd
Headers show

Commit Message

Anil Kumar Nov. 9, 2014, 12:45 p.m. UTC
If probe fails then we need to call pm_runtime_disable() to balance
out the previous pm_runtime_enable() call.

Signed-off-by: Anil Kumar <anilk4.v@gmail.com>
---
:100644 100644 0eed9b1... 99c747d... M	sound/soc/davinci/davinci-mcasp.c
 sound/soc/davinci/davinci-mcasp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Peter Ujfalusi Nov. 10, 2014, 12:53 p.m. UTC | #1
On 11/09/2014 02:45 PM, Anil Kumar wrote:
> If probe fails then we need to call pm_runtime_disable() to balance
> out the previous pm_runtime_enable() call.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Signed-off-by: Anil Kumar <anilk4.v@gmail.com>
> ---
> :100644 100644 0eed9b1... 99c747d... M	sound/soc/davinci/davinci-mcasp.c
>  sound/soc/davinci/davinci-mcasp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
> index 0eed9b1..99c747d 100644
> --- a/sound/soc/davinci/davinci-mcasp.c
> +++ b/sound/soc/davinci/davinci-mcasp.c
> @@ -1235,6 +1235,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
>  	ret = pm_runtime_get_sync(&pdev->dev);
>  	if (IS_ERR_VALUE(ret)) {
>  		dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
> +		pm_runtime_disable(&pdev->dev);
>  		return ret;
>  	}
>  
>
Mark Brown Nov. 10, 2014, 1:45 p.m. UTC | #2
On Sun, Nov 09, 2014 at 06:15:14PM +0530, Anil Kumar wrote:
> If probe fails then we need to call pm_runtime_disable() to balance
> out the previous pm_runtime_enable() call.

applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 0eed9b1..99c747d 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -1235,6 +1235,7 @@  static int davinci_mcasp_probe(struct platform_device *pdev)
 	ret = pm_runtime_get_sync(&pdev->dev);
 	if (IS_ERR_VALUE(ret)) {
 		dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
+		pm_runtime_disable(&pdev->dev);
 		return ret;
 	}