Commit da13d746 authored by John Stultz's avatar John Stultz Committed by Mark Brown

ASoC: hisilicon: Add error returns even for cases that shouldn't happen.

This patch addresses feedback from Mark Brown, adding a few
extra error returns in cases that shouldn't happen
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 86666c08
...@@ -395,6 +395,7 @@ static int hi6210_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -395,6 +395,7 @@ static int hi6210_i2s_hw_params(struct snd_pcm_substream *substream,
break; break;
default: default:
WARN_ONCE(1, "Invalid i2s->fmt MASTER_MASK. This shouldn't happen\n"); WARN_ONCE(1, "Invalid i2s->fmt MASTER_MASK. This shouldn't happen\n");
return -EINVAL;
} }
switch (i2s->format & SND_SOC_DAIFMT_FORMAT_MASK) { switch (i2s->format & SND_SOC_DAIFMT_FORMAT_MASK) {
...@@ -409,6 +410,7 @@ static int hi6210_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -409,6 +410,7 @@ static int hi6210_i2s_hw_params(struct snd_pcm_substream *substream,
break; break;
default: default:
WARN_ONCE(1, "Invalid i2s->fmt FORMAT_MASK. This shouldn't happen\n"); WARN_ONCE(1, "Invalid i2s->fmt FORMAT_MASK. This shouldn't happen\n");
return -EINVAL;
} }
val = hi6210_read_reg(i2s, HII2S_I2S_CFG); val = hi6210_read_reg(i2s, HII2S_I2S_CFG);
......
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