greybus: audio: return success for stop trigger if device removed
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Tue, 16 Feb 2016 16:46:33 +0000 (22:16 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 18 Feb 2016 00:03:40 +0000 (16:03 -0800)
In case GB codec module is already removed, no action is required
at the HW level. Thus, report SUCCESS to above layer.

Reporting error to above layer will cause repeated trials and won't
allow to update DPCM connections.

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio_codec.c

index 25b1042d3c776ed308b0fada7f6c14708f508210..d820116dd1961ee47c3e59d407c95e4c14a2a5be 100644 (file)
@@ -362,6 +362,10 @@ static int gbcodec_trigger(struct snd_pcm_substream *substream, int cmd,
                dev_err(dai->dev, "%d:Error during %s stream\n", ret,
                        start ? "Start" : "Stop");
 
+       /* in case device removed, return 0 for stop trigger */
+       if (stop && (ret == -ENODEV))
+               ret = 0;
+
 func_exit:
        mutex_unlock(&gb->lock);
        return ret;