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: <[email protected]> # 6.1 Link: thesofproject#4021 Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0ad84b1 commit cc755b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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)