greybus: audio: Fix incorrect codec state modification

In case module is removed dynamically with ongoing playback, during
module cleanup codec state is mistakenly modified. State should be
modified for module only. Fix this.

Fixes: 76414cb499b7 ("audio: Use single codec driver
registration")

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com> 
Signed-off-by: Alex Elder <elder@linaro.org>
This commit is contained in:
Vaibhav Agarwal 2016-07-12 04:56:00 -05:00 committed by Alex Elder
parent 3487394988
commit cf1caac6cd
1 changed files with 2 additions and 2 deletions

View File

@ -971,7 +971,7 @@ static void gbaudio_codec_cleanup(struct gbaudio_module_info *module)
ret = gb_audio_apbridgea_unregister_cport(data->connection,
i2s_port, cportid,
AUDIO_APBRIDGEA_DIRECTION_TX);
gbcodec->stream[0].state = GBAUDIO_CODEC_SHUTDOWN;
module->ctrlstate[0] = GBAUDIO_CODEC_SHUTDOWN;
}
if (cap_state == GBAUDIO_CODEC_START) {
@ -996,7 +996,7 @@ static void gbaudio_codec_cleanup(struct gbaudio_module_info *module)
ret = gb_audio_apbridgea_unregister_cport(data->connection,
i2s_port, cportid,
AUDIO_APBRIDGEA_DIRECTION_RX);
gbcodec->stream[1].state = GBAUDIO_CODEC_SHUTDOWN;
module->ctrlstate[1] = GBAUDIO_CODEC_SHUTDOWN;
}
}