Commit cf1caac6 authored by Vaibhav Agarwal's avatar Vaibhav Agarwal Committed by Alex Elder

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: default avatarVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com> 
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
parent 34873949
......@@ -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;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment