Commit dcdab582 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-dai: add snd_soc_dai_remove()

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_remvoe() and use it.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87imruhn1x.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent cfd9b5fb
......@@ -165,6 +165,7 @@ snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai,
void snd_soc_dai_suspend(struct snd_soc_dai *dai);
void snd_soc_dai_resume(struct snd_soc_dai *dai);
int snd_soc_dai_probe(struct snd_soc_dai *dai);
int snd_soc_dai_remove(struct snd_soc_dai *dai);
struct snd_soc_dai_ops {
/*
......
......@@ -992,13 +992,12 @@ static void soc_remove_dai(struct snd_soc_dai *dai, int order)
dai->driver->remove_order != order)
return;
if (dai->driver->remove) {
err = dai->driver->remove(dai);
if (err < 0)
dev_err(dai->dev,
"ASoC: failed to remove %s: %d\n",
dai->name, err);
}
err = snd_soc_dai_remove(dai);
if (err < 0)
dev_err(dai->dev,
"ASoC: failed to remove %s: %d\n",
dai->name, err);
dai->probed = 0;
}
......
......@@ -372,3 +372,10 @@ int snd_soc_dai_probe(struct snd_soc_dai *dai)
return dai->driver->probe(dai);
return 0;
}
int snd_soc_dai_remove(struct snd_soc_dai *dai)
{
if (dai->driver->remove)
return dai->driver->remove(dai);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment