summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dai.c
diff options
context:
space:
mode:
authorGyeongtaek Lee <gt82.lee@samsung.com>2021-05-14 14:30:51 +0200
committerMark Brown <broonie@kernel.org>2021-05-19 15:19:08 +0200
commit8b4ba1d31771114ebb717523c2bdb5ea75b4dec8 (patch)
tree16b6b58654f24f43a3644cfed895493c128b11a6 /sound/soc/soc-dai.c
parentASoC: wm8750: convert to the json-schema (diff)
downloadlinux-8b4ba1d31771114ebb717523c2bdb5ea75b4dec8.tar.xz
linux-8b4ba1d31771114ebb717523c2bdb5ea75b4dec8.zip
ASoC: soc-dai: fix up hw params only if it is needed
If fixed hw params won't be used, fixing up isn't needed also. Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com> Link: https://lore.kernel.org/r/000401d748bc$fa466d50$eed347f0$@samsung.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dai.c')
-rw-r--r--sound/soc/soc-dai.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 080fbe053fc5..4df1aae8abf3 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -327,14 +327,15 @@ int snd_soc_dai_hw_params(struct snd_soc_dai *dai,
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
int ret = 0;
- /* perform any topology hw_params fixups before DAI */
- ret = snd_soc_link_be_hw_params_fixup(rtd, params);
- if (ret < 0)
- goto end;
-
if (dai->driver->ops &&
- dai->driver->ops->hw_params)
+ dai->driver->ops->hw_params) {
+ /* perform any topology hw_params fixups before DAI */
+ ret = snd_soc_link_be_hw_params_fixup(rtd, params);
+ if (ret < 0)
+ goto end;
+
ret = dai->driver->ops->hw_params(substream, params, dai);
+ }
/* mark substream if succeeded */
if (ret == 0)