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>
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) {
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;
}
}