diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-10-06 01:29:56 +0200 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-06 21:02:56 +0200 |
commit | ac60155f7afa3fd819befa35c2740a7a0d2f1a39 (patch) | |
tree | 2e3c5e858b608fd6c0a7583f580b76d6242c57b1 /sound/soc/codecs/cs42l51.c | |
parent | ASoC: wm8990: Remove incorrect comments (diff) | |
download | linux-ac60155f7afa3fd819befa35c2740a7a0d2f1a39.tar.xz linux-ac60155f7afa3fd819befa35c2740a7a0d2f1a39.zip |
ASoC: Return early with -EINVAL if invalid dai format is detected
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/cs42l51.c')
-rw-r--r-- | sound/soc/codecs/cs42l51.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index 286878d22b6a..8c3c8205d19e 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c @@ -288,7 +288,6 @@ static int cs42l51_set_dai_fmt(struct snd_soc_dai *codec_dai, { struct snd_soc_codec *codec = codec_dai->codec; struct cs42l51_private *cs42l51 = snd_soc_codec_get_drvdata(codec); - int ret = 0; switch (format & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: @@ -298,7 +297,7 @@ static int cs42l51_set_dai_fmt(struct snd_soc_dai *codec_dai, break; default: dev_err(codec->dev, "invalid DAI format\n"); - ret = -EINVAL; + return -EINVAL; } switch (format & SND_SOC_DAIFMT_MASTER_MASK) { @@ -309,11 +308,11 @@ static int cs42l51_set_dai_fmt(struct snd_soc_dai *codec_dai, cs42l51->func = MODE_SLAVE_AUTO; break; default: - ret = -EINVAL; - break; + dev_err(codec->dev, "Unknown master/slave configuration\n"); + return -EINVAL; } - return ret; + return 0; } struct cs42l51_ratios { |