During shutdown sequence, in case all modules are already removed,
codec state is not updated. Though it's not causing any harm for now,
but it's good to maintain proper codec state. Fix this.
Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Alex Elder <elder@linaro.org>
if (list_empty(&codec->module_list)) {
dev_err(codec->dev, "No codec module available\n");
+ codec->stream[substream->stream].state = GBAUDIO_CODEC_SHUTDOWN;
+ codec->stream[substream->stream].dai_name = NULL;
mutex_unlock(&codec->lock);
pm_relax(dai->dev);
return;
mutex_lock(&codec->lock);
if (list_empty(&codec->module_list)) {
dev_err(codec->dev, "No codec module available\n");
+ if (mute) {
+ codec->stream[stream].state = GBAUDIO_CODEC_STOP;
+ ret = 0;
+ } else {
+ ret = -ENODEV;
+ }
mutex_unlock(&codec->lock);
- return -ENODEV;
+ return ret;
}
list_for_each_entry(module, &codec->module_list, list) {