Skip to content

Commit cc755b4

Browse files
bardliaobroonie
authored andcommitted
ASoC: SOF: keep prepare/unprepare widgets in sink path
The existing code return when a widget doesn't need to prepare/unprepare. This will prevent widgets in the sink path from being prepared/unprepared. Cc: <stable@vger.kernel.org> # 6.1 Link: thesofproject#4021 Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230118101255.29139-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0ad84b1 commit cc755b4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

sound/soc/sof/sof-audio.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,17 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg
271271
struct snd_sof_widget *swidget = widget->dobj.private;
272272
struct snd_soc_dapm_path *p;
273273

274-
/* return if the widget is in use or if it is already unprepared */
274+
/* skip if the widget is in use or if it is already unprepared */
275275
if (!swidget || !swidget->prepared || swidget->use_count > 0)
276-
return;
276+
goto sink_unprepare;
277277

278278
if (widget_ops[widget->id].ipc_unprepare)
279279
/* unprepare the source widget */
280280
widget_ops[widget->id].ipc_unprepare(swidget);
281281

282282
swidget->prepared = false;
283283

284+
sink_unprepare:
284285
/* unprepare all widgets in the sink paths */
285286
snd_soc_dapm_widget_for_each_sink_path(widget, p) {
286287
if (!p->walking && p->sink->dobj.private) {

0 commit comments

Comments
 (0)