[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1491938118-19108-1-git-send-email-john.stultz@linaro.org>
Date: Tue, 11 Apr 2017 12:15:16 -0700
From: John Stultz <john.stultz@...aro.org>
To: lkml <linux-kernel@...r.kernel.org>
Cc: John Stultz <john.stultz@...aro.org>,
Zhangfei Gao <zhangfei.gao@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Wei Xu <xuwei5@...ilicon.com>,
Rob Herring <robh+dt@...nel.org>,
Andy Green <andy@...mcat.com>,
Dave Long <dave.long@...aro.org>,
Guodong Xu <guodong.xu@...aro.org>
Subject: [PATCH 1/3] 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
Cc: Zhangfei Gao <zhangfei.gao@...aro.org>
Cc: Liam Girdwood <lgirdwood@...il.com>
Cc: Mark Brown <broonie@...nel.org>
Cc: Jaroslav Kysela <perex@...ex.cz>
Cc: Wei Xu <xuwei5@...ilicon.com>
Cc: Rob Herring <robh+dt@...nel.org>
Cc: Andy Green <andy@...mcat.com>
Cc: Dave Long <dave.long@...aro.org>
Cc: Guodong Xu <guodong.xu@...aro.org>
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
sound/soc/hisilicon/hi6210-i2s.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/hisilicon/hi6210-i2s.c b/sound/soc/hisilicon/hi6210-i2s.c
index 45691b70..1909bfc 100644
--- a/sound/soc/hisilicon/hi6210-i2s.c
+++ b/sound/soc/hisilicon/hi6210-i2s.c
@@ -395,6 +395,7 @@ static int hi6210_i2s_hw_params(struct snd_pcm_substream *substream,
break;
default:
WARN_ONCE(1, "Invalid i2s->fmt MASTER_MASK. This shouldn't happen\n");
+ return -EINVAL;
}
switch (i2s->format & SND_SOC_DAIFMT_FORMAT_MASK) {
@@ -409,6 +410,7 @@ static int hi6210_i2s_hw_params(struct snd_pcm_substream *substream,
break;
default:
WARN_ONCE(1, "Invalid i2s->fmt FORMAT_MASK. This shouldn't happen\n");
+ return -EINVAL;
}
val = hi6210_read_reg(i2s, HII2S_I2S_CFG);
--
2.7.4
Powered by blists - more mailing lists