[alsa-devel] [PATCH] ASoC: simple-card: un-implemented .set_fmt is not error
Current simple-card returns error if DAI doesn't support .set_fmt callback. But the return value -ENOTSUPP means "not supported", it is not error. This patch avoids such case
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/generic/simple-card.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 62befbd..b75c7b1 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -29,6 +29,11 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, if (!ret && daifmt) ret = snd_soc_dai_set_fmt(dai, daifmt);
+ if (ret == -ENOTSUPP) { + dev_warn(dai->dev, "ASoC: set_fmt is not supported\n"); + ret = 0; + } + if (!ret && set->sysclk) ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk, 0);
On Thu, Oct 17, 2013 at 05:25:45PM -0700, Kuninori Morimoto wrote:
Current simple-card returns error if DAI doesn't support .set_fmt callback. But the return value -ENOTSUPP means "not supported", it is not error. This patch avoids such case
Applied, thanks.
participants (2)
-
Kuninori Morimoto
-
Mark Brown