summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-07-22 10:34:09 +0900
committerMark Brown <broonie@kernel.org>2019-07-23 18:14:20 +0100
commit1dea80d4b2bd3b53c58f008ca2bcd73182583711 (patch)
tree1387a2e2c907ea3526bb5f57cc4e596ebda87cf1 /sound/soc/soc-pcm.c
parent5c0769af4caf8fbdad2e9c0051ab0081b8e22b0a (diff)
downloadlinux-stable-1dea80d4b2bd3b53c58f008ca2bcd73182583711.tar.gz
linux-stable-1dea80d4b2bd3b53c58f008ca2bcd73182583711.tar.bz2
linux-stable-1dea80d4b2bd3b53c58f008ca2bcd73182583711.zip
ASoC: soc-dai: add snd_soc_dai_delay()
Current ALSA SoC is directly using dai->driver->ops->xxx, thus, it has deep nested bracket, and it makes code unreadable. This patch adds new snd_soc_dai_delay() and use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87o91mhn3i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index a10627f1ceff..f3137723301c 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1169,14 +1169,11 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream)
/* base delay if assigned in pointer callback */
delay = runtime->delay;
- if (cpu_dai->driver->ops->delay)
- delay += cpu_dai->driver->ops->delay(substream, cpu_dai);
+ delay += snd_soc_dai_delay(cpu_dai, substream);
for_each_rtd_codec_dai(rtd, i, codec_dai) {
- if (codec_dai->driver->ops->delay)
- codec_delay = max(codec_delay,
- codec_dai->driver->ops->delay(substream,
- codec_dai));
+ codec_delay = max(codec_delay,
+ snd_soc_dai_delay(codec_dai, substream));
}
delay += codec_delay;