aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/sof/sof-audio.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2022-12-21 12:23:18 +0200
committerMark Brown <broonie@kernel.org>2022-12-25 23:32:29 +0000
commit5315411729b188a8d39252a8c4b9bbdbc3ba6d92 (patch)
tree1416f2e27faf3bd0888f7aab3dee2c36ce949f59 /sound/soc/sof/sof-audio.c
parentLinux 6.2-rc1 (diff)
downloadwireguard-linux-5315411729b188a8d39252a8c4b9bbdbc3ba6d92.tar.xz
wireguard-linux-5315411729b188a8d39252a8c4b9bbdbc3ba6d92.zip
ASoC: SOF: sof-audio: Treat tplg_ops->route_setup() as optional
Other topology ops have been treated as optional, including the route_free. Handle the route_setup in a conforming way as optional callback. Note: we do not have checks for the callbacks itself which makes them all optional in practice. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Link: https://lore.kernel.org/r/20221221102328.9635-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/sof-audio.c')
-rw-r--r--sound/soc/sof/sof-audio.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
index 7306a2649857..2c7d942427c1 100644
--- a/sound/soc/sof/sof-audio.c
+++ b/sound/soc/sof/sof-audio.c
@@ -174,7 +174,6 @@ int sof_route_setup(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *wsourc
struct snd_sof_widget *sink_widget = wsink->dobj.private;
struct snd_sof_route *sroute;
bool route_found = false;
- int ret;
/* ignore routes involving virtual widgets in topology */
switch (src_widget->id) {
@@ -212,9 +211,12 @@ int sof_route_setup(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *wsourc
if (sroute->setup)
return 0;
- ret = ipc_tplg_ops->route_setup(sdev, sroute);
- if (ret < 0)
- return ret;
+ if (ipc_tplg_ops->route_setup) {
+ int ret = ipc_tplg_ops->route_setup(sdev, sroute);
+
+ if (ret < 0)
+ return ret;
+ }
sroute->setup = true;
return 0;