summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-03-08 16:59:40 (GMT)
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-08 18:23:46 (GMT)
commit5e4ba569a5aa631852ec8240f11142392116633d (patch)
treebf78bf243ebe891374300815487bf54de21a5866 /sound
parent33593b52ebb0d6d37d96bd5e01a31951fc3b8ddf (diff)
downloadlinux-fsl-qoriq-5e4ba569a5aa631852ec8240f11142392116633d.tar.xz
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: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c90bb01..93a0daa 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1531,14 +1531,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
if (dai_link->dai_fmt) {
ret = snd_soc_dai_set_fmt(card->rtd[i].codec_dai,
dai_link->dai_fmt);
- if (ret != 0)
+ if (ret != 0 && ret != -ENOTSUPP)
dev_warn(card->rtd[i].codec_dai->dev,
"Failed to set DAI format: %d\n",
ret);
ret = snd_soc_dai_set_fmt(card->rtd[i].cpu_dai,
dai_link->dai_fmt);
- if (ret != 0)
+ if (ret != 0 && ret != -ENOTSUPP)
dev_warn(card->rtd[i].cpu_dai->dev,
"Failed to set DAI format: %d\n",
ret);
@@ -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)
{
- if (dai->driver && dai->driver->ops->set_fmt)
- return dai->driver->ops->set_fmt(dai, fmt);
- else
+ if (dai->driver == NULL)
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);