diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-07-22 10:35:29 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-07-23 18:14:25 +0100 |
commit | b423c4202135f7794e0a9c55a884f5933d8e7156 (patch) | |
tree | bc924b66372f8479638949e6760c70d69a877235 /sound/soc/soc-core.c | |
parent | dcdab5820edd6123911dbd767ee1e389008b6a83 (diff) | |
download | lwn-b423c4202135f7794e0a9c55a884f5933d8e7156.tar.gz lwn-b423c4202135f7794e0a9c55a884f5933d8e7156.zip |
ASoC: soc-dai: add snd_soc_dai_compress_new()
Current ALSA SoC is directly using dai->driver->xxx,
thus, it has deep nested bracket, and it makes code unreadable.
This patch adds new snd_soc_dai_compress_new() and use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h87ehn1a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 727fd342b3fb..458b090f026a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1545,15 +1545,16 @@ static int soc_probe_link_dais(struct snd_soc_card *card, num = rtd->dai_link->id; } - if (cpu_dai->driver->compress_new) { - /* create compress_device" */ - ret = cpu_dai->driver->compress_new(rtd, num); - if (ret < 0) { + /* create compress_device if possible */ + ret = snd_soc_dai_compress_new(cpu_dai, rtd, num); + if (ret != -ENOTSUPP) { + if (ret < 0) dev_err(card->dev, "ASoC: can't create compress %s\n", dai_link->stream_name); - return ret; - } - } else if (!dai_link->params) { + return ret; + } + + if (!dai_link->params) { /* create the pcm */ ret = soc_new_pcm(rtd, num); if (ret < 0) { |