[PATCH -next] ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Zhang Qilong zhangqilong3 at huawei.com
Thu Sep 22 16:58:46 CEST 2022


Using the newest pm_runtime_resume_and_get is more appropriate
for simplifing code here.

Signed-off-by: Zhang Qilong <zhangqilong3 at huawei.com>
---
 sound/soc/soc-component.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index e12f8244242b..659b9ade4158 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -1213,11 +1213,9 @@ int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd,
 	int i;
 
 	for_each_rtd_components(rtd, i, component) {
-		int ret = pm_runtime_get_sync(component->dev);
-		if (ret < 0 && ret != -EACCES) {
-			pm_runtime_put_noidle(component->dev);
+		int ret = pm_runtime_resume_and_get(component->dev);
+		if (ret < 0 && ret != -EACCES)
 			return soc_component_ret(component, ret);
-		}
 		/* mark stream if succeeded */
 		soc_component_mark_push(component, stream, pm);
 	}
-- 
2.25.1



More information about the Alsa-devel mailing list