devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ryder Lee <ryder.lee-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	Garlic Tseng
	<garlic.tseng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH 1/4] ASoC: mediatek: fix error handling in mt2701_afe_pcm_dev_probe()
Date: Thu, 28 Dec 2017 20:27:08 +0800	[thread overview]
Message-ID: <1514464028.21578.2.camel@mtkswgap22> (raw)
In-Reply-To: <18b7f0ec484300af795b1873efab96e51393459c.1514190169.git.ryder.lee-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

Sorry, please ignore this series. I will send new ones later.

On Mon, 2017-12-25 at 16:28 +0800, Ryder Lee wrote:
> Fix unbalanced error handling path which will get incorrect counts
> if probe failed. The .remove() should be adjusted accordingly.
> 
> Signed-off-by: Ryder Lee <ryder.lee-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
>  sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 23 ++++++++++-------------
>  1 file changed, 10 insertions(+), 13 deletions(-)
> 
> diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
> index 8fda182..b3f6f73 100644
> --- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
> +++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
> @@ -1591,8 +1591,12 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, afe);
>  	pm_runtime_enable(&pdev->dev);
> -	if (!pm_runtime_enabled(&pdev->dev))
> -		goto err_pm_disable;
> +	if (!pm_runtime_enabled(&pdev->dev)) {
> +		ret = mt2701_afe_runtime_resume(&pdev->dev);
> +		if (ret)
> +			goto err_pm_disable;
> +	}
> +
>  	pm_runtime_get_sync(&pdev->dev);
>  
>  	ret = snd_soc_register_platform(&pdev->dev, &mtk_afe_pcm_platform);
> @@ -1610,16 +1614,12 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
>  		goto err_dai_component;
>  	}
>  
> -	mt2701_afe_runtime_resume(&pdev->dev);
> -
>  	return 0;
>  
>  err_dai_component:
> -	snd_soc_unregister_component(&pdev->dev);
> -
> -err_platform:
>  	snd_soc_unregister_platform(&pdev->dev);
> -
> +err_platform:
> +	pm_runtime_put_sync(&pdev->dev);
>  err_pm_disable:
>  	pm_runtime_disable(&pdev->dev);
>  
> @@ -1628,17 +1628,14 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
>  
>  static int mt2701_afe_pcm_dev_remove(struct platform_device *pdev)
>  {
> -	struct mtk_base_afe *afe = platform_get_drvdata(pdev);
> -
> +	pm_runtime_put_sync(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
>  	if (!pm_runtime_status_suspended(&pdev->dev))
>  		mt2701_afe_runtime_suspend(&pdev->dev);
> -	pm_runtime_put_sync(&pdev->dev);
>  
>  	snd_soc_unregister_component(&pdev->dev);
>  	snd_soc_unregister_platform(&pdev->dev);
> -	/* disable afe clock */
> -	mt2701_afe_disable_clock(afe);
> +
>  	return 0;
>  }
>  


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2017-12-28 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-25  8:28 [PATCH 1/4] ASoC: mediatek: fix error handling in mt2701_afe_pcm_dev_probe() Ryder Lee
2017-12-25  8:28 ` [PATCH 2/4] ASoC: mediatek: rework clock functions for MT2701 Ryder Lee
2017-12-25  8:28 ` [PATCH 3/4] ASoC: mediatek: cleanup audio driver " Ryder Lee
     [not found] ` <18b7f0ec484300af795b1873efab96e51393459c.1514190169.git.ryder.lee-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-12-25  8:28   ` [PATCH 4/4] ASoC: mediatek: update clock properties for mt2701 Ryder Lee
2017-12-28 12:27   ` Ryder Lee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1514464028.21578.2.camel@mtkswgap22 \
    --to=ryder.lee-nus5lvnupcjwk0htik3j/w@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=garlic.tseng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).