From: Vaibhav Agarwal Date: Tue, 16 Feb 2016 16:46:33 +0000 (+0530) Subject: greybus: audio: return success for stop trigger if device removed X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~668 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b07868bda2fb61b784dc260dd075d84ac994d599;p=karo-tx-linux.git 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 Reviewed-by: Mark Greer Signed-off-by: Greg Kroah-Hartman --- 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;