Re: [PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

2022-04-20 Thread Pavel Machek
Hi!

> From: Minghao Chi 
> 
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
> 
> Reported-by: Zeal Robot 
> Signed-off-by: Minghao Chi 
> ---
>  sound/soc/fsl/fsl_esai.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
> index ed444e8f1d6b..1a2bdf8e76f0 100644
> --- a/sound/soc/fsl/fsl_esai.c
> +++ b/sound/soc/fsl/fsl_esai.c
> @@ -1050,11 +1050,9 @@ static int fsl_esai_probe(struct platform_device *pdev)
>   goto err_pm_disable;
>   }
>  
> - ret = pm_runtime_get_sync(>dev);
> - if (ret < 0) {
> - pm_runtime_put_noidle(>dev);
> + ret = pm_runtime_resume_and_get(>dev);
> + if (ret < 0)
>   goto err_pm_get_sync;
> - }
>  
>   ret = fsl_esai_hw_init(esai_priv);
>   if (ret)

Please take a closer look at that function.

a) error labels are now misnamed

b) there's leak if
   ret = fsl_esai_hw_init(esai_priv);
   if (ret)
 goto err_pm_get_sync;

happens.

Best regards,
Pavel   
   

-- 
People of Russia, stop Putin before his war on Ukraine escalates.


signature.asc
Description: Digital signature


Re: [PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

2022-04-12 Thread Shengjiu Wang
On Tue, Apr 12, 2022 at 4:30 PM  wrote:

> From: Minghao Chi 
>
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
>
> Reported-by: Zeal Robot 
> Signed-off-by: Minghao Chi 
>

Acked-by: Shengjiu Wang 

Best regards
Wang Shengjiu

> ---
>  sound/soc/fsl/fsl_esai.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
> index ed444e8f1d6b..1a2bdf8e76f0 100644
> --- a/sound/soc/fsl/fsl_esai.c
> +++ b/sound/soc/fsl/fsl_esai.c
> @@ -1050,11 +1050,9 @@ static int fsl_esai_probe(struct platform_device
> *pdev)
> goto err_pm_disable;
> }
>
> -   ret = pm_runtime_get_sync(>dev);
> -   if (ret < 0) {
> -   pm_runtime_put_noidle(>dev);
> +   ret = pm_runtime_resume_and_get(>dev);
> +   if (ret < 0)
> goto err_pm_get_sync;
> -   }
>
> ret = fsl_esai_hw_init(esai_priv);
> if (ret)
> --
> 2.25.1
>
>


Re: [PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

2022-04-12 Thread Mark Brown
On Tue, 12 Apr 2022 08:30:00 +, cgel@gmail.com wrote:
> From: Minghao Chi 
> 
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
  commit: c721905c54d913db0102973dbcdfb48d91146a2d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark