summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_adsp.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-06-13 14:17:12 +0100
committerMark Brown <broonie@kernel.org>2016-06-13 16:49:51 +0100
commit28ee3d73773e2d9ae922f7496723ab5c92cc16de (patch)
tree5a9a386ab09701e7feab4b9abaa2c60000597867 /sound/soc/codecs/wm_adsp.c
parent8d280664d26538cd37e7c08b1c2b58fe006cc482 (diff)
downloadop-kernel-dev-28ee3d73773e2d9ae922f7496723ab5c92cc16de.zip
op-kernel-dev-28ee3d73773e2d9ae922f7496723ab5c92cc16de.tar.gz
ASoC: wm_adsp: Treat missing compressed buffer as a fatal error
If the DSP is powered down whilst a compressed stream is being processed we should treat this as a fatal error, clearly the stream is no longer valid. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r--sound/soc/codecs/wm_adsp.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 8ed1cde..7e42474 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -3037,12 +3037,7 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,
buf = compr->buf;
- if (!compr->buf) {
- ret = -ENXIO;
- goto out;
- }
-
- if (compr->buf->error) {
+ if (!compr->buf || compr->buf->error) {
snd_compr_stop_error(stream, SNDRV_PCM_STATE_XRUN);
ret = -EIO;
goto out;
@@ -3161,10 +3156,7 @@ static int wm_adsp_compr_read(struct wm_adsp_compr *compr,
adsp_dbg(dsp, "Requested read of %zu bytes\n", count);
- if (!compr->buf)
- return -ENXIO;
-
- if (compr->buf->error) {
+ if (!compr->buf || compr->buf->error) {
snd_compr_stop_error(compr->stream, SNDRV_PCM_STATE_XRUN);
return -EIO;
}
OpenPOWER on IntegriCloud