summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/audio_codec.c
diff options
context:
space:
mode:
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>2016-02-16 22:16:33 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-17 16:03:40 -0800
commitb07868bda2fb61b784dc260dd075d84ac994d599 (patch)
treeba594822e37f0a6232f34c852c3db0e4c7528fb9 /drivers/staging/greybus/audio_codec.c
parent29386f058a758f5ef6e8a522101fcbfd0ef07a19 (diff)
downloadlinux-b07868bda2fb61b784dc260dd075d84ac994d599.tar.bz2
greybus: audio: return success for stop trigger if device removed
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>
Diffstat (limited to 'drivers/staging/greybus/audio_codec.c')
-rw-r--r--drivers/staging/greybus/audio_codec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index 25b1042d3c77..d820116dd196 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -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;