From: Pierre-Louis Bossart Date: Thu, 16 Jun 2022 22:04:18 +0000 (-0500) Subject: ASoC: Intel: skylake: skl-pcm: use pm_runtime_resume_and_get() X-Git-Tag: v6.0-rc1~93^2~8^2~37^2~64^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7213170a9515109322f75c08b5268d8e9cdad8e4;p=thirdparty%2Flinux.git ASoC: Intel: skylake: skl-pcm: use pm_runtime_resume_and_get() The current code does not check for errors and does not release the reference on errors. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Acked-by: Cezary Rojewski Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220616220427.136036-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 55f310e91b55c..9d72ebd812af9 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1380,7 +1380,10 @@ static int skl_platform_soc_probe(struct snd_soc_component *component) const struct skl_dsp_ops *ops; int ret; - pm_runtime_get_sync(component->dev); + ret = pm_runtime_resume_and_get(component->dev); + if (ret < 0 && ret != -EACCES) + return ret; + if (bus->ppcap) { skl->component = component;