Commit 5e4ba569 authored by Shawn Guo's avatar Shawn Guo Committed by Mark Brown

ASoC: core: missing set_fmt should not be complaint

Not having a DAI link set_fmt operation is perfectly normal and
should not be complaint.
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 33593b52
...@@ -1531,14 +1531,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1531,14 +1531,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
if (dai_link->dai_fmt) { if (dai_link->dai_fmt) {
ret = snd_soc_dai_set_fmt(card->rtd[i].codec_dai, ret = snd_soc_dai_set_fmt(card->rtd[i].codec_dai,
dai_link->dai_fmt); dai_link->dai_fmt);
if (ret != 0) if (ret != 0 && ret != -ENOTSUPP)
dev_warn(card->rtd[i].codec_dai->dev, dev_warn(card->rtd[i].codec_dai->dev,
"Failed to set DAI format: %d\n", "Failed to set DAI format: %d\n",
ret); ret);
ret = snd_soc_dai_set_fmt(card->rtd[i].cpu_dai, ret = snd_soc_dai_set_fmt(card->rtd[i].cpu_dai,
dai_link->dai_fmt); dai_link->dai_fmt);
if (ret != 0) if (ret != 0 && ret != -ENOTSUPP)
dev_warn(card->rtd[i].cpu_dai->dev, dev_warn(card->rtd[i].cpu_dai->dev,
"Failed to set DAI format: %d\n", "Failed to set DAI format: %d\n",
ret); ret);
...@@ -2971,10 +2971,11 @@ EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll); ...@@ -2971,10 +2971,11 @@ EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll);
*/ */
int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{ {
if (dai->driver && dai->driver->ops->set_fmt) if (dai->driver == NULL)
return dai->driver->ops->set_fmt(dai, fmt);
else
return -EINVAL; return -EINVAL;
if (dai->driver->ops->set_fmt == NULL)
return -ENOTSUPP;
return dai->driver->ops->set_fmt(dai, fmt);
} }
EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt); EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt);
......
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