ASoC: Intel: sst: Fix error-code check in sst_pause_stream()
authorHans de Goede <hdegoede@redhat.com>
Sun, 18 Feb 2018 22:01:38 +0000 (23:01 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 1 Mar 2018 16:22:44 +0000 (16:22 +0000)
The value returned by sst_prepare_and_post_msg() is a negated SST_ERR_*
value, so we must check for -SST_ERR_INVALID_STREAM_ID. Note that
sst_pause_resume() already has the correct check.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/atom/sst/sst_stream.c

index 7ee6aeb7e0af5a63683a560bd65c2243927c67bd..b082b0922a7a5d0b7c3c7a8ad388cf33d1c386e7 100644 (file)
@@ -253,7 +253,7 @@ int sst_pause_stream(struct intel_sst_drv *sst_drv_ctx, int str_id)
                if (retval == 0) {
                        str_info->prev = str_info->status;
                        str_info->status = STREAM_PAUSED;
-               } else if (retval == SST_ERR_INVALID_STREAM_ID) {
+               } else if (retval == -SST_ERR_INVALID_STREAM_ID) {
                        retval = -EINVAL;
                        mutex_lock(&sst_drv_ctx->sst_lock);
                        sst_clean_stream(str_info);