From: Ranjani Sridharan Date: Tue, 26 Apr 2022 17:17:42 +0000 (-0700) Subject: ASoC: SOF: clarify use of widget complete flag X-Git-Tag: v6.6.17~6759^2~68^2~73^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=463a809ba8efa127484d16ff588e3bcdb63fe41e;p=platform%2Fkernel%2Flinux-rpi.git ASoC: SOF: clarify use of widget complete flag Currently, the complete flag is used only for the snd_soc_dapm_scheduler type widgets to indicate that the pipeline has been set up. All other widgets do not need it. Add a comment to clarify its usage and set the complete flag to false only for the scheduler widget in sof_widget_free(). Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220426171743.171061-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index b2da078..791d245 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -58,8 +58,6 @@ int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) err = ret; } - swidget->complete = 0; - /* * free the scheduler widget (same as pipe_widget) associated with the current swidget. * skip for static pipelines @@ -68,6 +66,7 @@ int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) ret = sof_widget_free(sdev, swidget->pipe_widget); if (ret < 0 && !err) err = ret; + swidget->pipe_widget->complete = 0; } if (!err) diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h index bf75913..4dbee02 100644 --- a/sound/soc/sof/sof-audio.h +++ b/sound/soc/sof/sof-audio.h @@ -327,6 +327,10 @@ struct snd_sof_widget { struct snd_soc_component *scomp; int comp_id; int pipeline_id; + /* + * complete flag is used to indicate that pipeline set up is complete for scheduler type + * widgets. It is unused for all other widget types. + */ int complete; int use_count; /* use_count will be protected by the PCM mutex held by the core */ int core;