ASoC: SOF: pcm: fix pm_runtime imbalance in error handling

When an error occurs, we need to make sure the device can pm_runtime
suspend instead of keeping it active.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230512103315.8921-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
This commit is contained in:
Pierre-Louis Bossart 2023-05-12 13:33:14 +03:00 коммит произвёл Mark Brown
Родитель 3de975862f
Коммит da0fe8fd51
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 24D68B725D5487D0
1 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -643,16 +643,17 @@ static int sof_pcm_probe(struct snd_soc_component *component)
"%s/%s",
plat_data->tplg_filename_prefix,
plat_data->tplg_filename);
if (!tplg_filename)
return -ENOMEM;
ret = snd_sof_load_topology(component, tplg_filename);
if (ret < 0) {
dev_err(component->dev, "error: failed to load DSP topology %d\n",
ret);
return ret;
if (!tplg_filename) {
ret = -ENOMEM;
goto pm_error;
}
ret = snd_sof_load_topology(component, tplg_filename);
if (ret < 0)
dev_err(component->dev, "error: failed to load DSP topology %d\n",
ret);
pm_error:
pm_runtime_mark_last_busy(component->dev);
pm_runtime_put_autosuspend(component->dev);