Skip to content

Commit c02c3b6

Browse files
RanderWangplbossart
authored andcommitted
ASoC: SOF: don't unprepare widget used other pipelines
If multiple pipeline are mixed into one, we can't unprepare the widget used by other pipelines. This patch checks use_count to address this case. Signed-off-by: Rander Wang <rander.wang@intel.com>
1 parent e8bc287 commit c02c3b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/sof/sof-audio.c

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

273-
/* it is already unprepared */
274-
if (!swidget->prepared)
273+
/* return if the widget is in use or if it is already unprepared */
274+
if (!swidget->prepared || swidget->use_count > 1)
275275
return;
276276

277277
if (widget_ops[widget->id].ipc_unprepare)

0 commit comments

Comments
 (0)