summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/topology.c
diff options
context:
space:
mode:
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>2021-09-27 14:05:06 +0200
committerMark Brown <broonie@kernel.org>2021-10-01 21:48:19 +0200
commit415717e1e367debe6344533f98eaeceb2dce52b3 (patch)
tree3c2dd3def9bee20ebaac297756f5613678b7b5d6 /sound/soc/sof/topology.c
parentASoC: rt5682: move clk related code to rt5682_i2c_probe (diff)
downloadlinux-415717e1e367debe6344533f98eaeceb2dce52b3.tar.xz
linux-415717e1e367debe6344533f98eaeceb2dce52b3.zip
ASoC: topology: change the complete op in snd_soc_tplg_ops to return int
In the SOF driver, the operations performed in the complete callback can fail and therefore topology loading should return an error in such cases. So, change the signature of the complete op in struct snd_soc_tplg_ops to return an int to return the error. Also, amend the complete callback functions in the SOF driver and the SKL driver to conform with the new signature. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20210927120517.20505-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/topology.c')
-rw-r--r--sound/soc/sof/topology.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index cc9585bfa4e9..96b8791f7cc1 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -3567,10 +3567,11 @@ int snd_sof_complete_pipeline(struct device *dev,
}
/* completion - called at completion of firmware loading */
-static void sof_complete(struct snd_soc_component *scomp)
+static int sof_complete(struct snd_soc_component *scomp)
{
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
struct snd_sof_widget *swidget;
+ int ret;
/* some widget types require completion notificattion */
list_for_each_entry(swidget, &sdev->widget_list, list) {
@@ -3579,8 +3580,11 @@ static void sof_complete(struct snd_soc_component *scomp)
switch (swidget->id) {
case snd_soc_dapm_scheduler:
- swidget->complete =
- snd_sof_complete_pipeline(scomp->dev, swidget);
+ ret = snd_sof_complete_pipeline(scomp->dev, swidget);
+ if (ret < 0)
+ return ret;
+
+ swidget->complete = ret;
break;
default:
break;
@@ -3590,7 +3594,7 @@ static void sof_complete(struct snd_soc_component *scomp)
* cache initial values of SOF kcontrols by reading DSP value over
* IPC. It may be overwritten by alsa-mixer after booting up
*/
- snd_sof_cache_kcontrol_val(scomp);
+ return snd_sof_cache_kcontrol_val(scomp);
}
/* manifest - optional to inform component of manifest */