dai: verify if DMA channel exists in dai_prepare

Checks if DMA channel exists in dai_prepare. This way we will
avoid exception in case DAI config hasn't been called before.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2019-10-15 09:47:51 +02:00 committed by Tomasz Lauda
parent 3fc0e27b06
commit 6f26cfd8c4
1 changed files with 7 additions and 0 deletions

View File

@ -441,6 +441,13 @@ static int dai_prepare(struct comp_dev *dev)
dev->position = 0;
if (!dd->chan) {
trace_dai_error_with_ids(dev, "dai_prepare() error: Missing "
"dd->chan.");
comp_set_state(dev, COMP_TRIGGER_RESET);
return -EINVAL;
}
if (!dd->config.elem_array.elems) {
trace_dai_error_with_ids(dev, "dai_prepare() error: Missing "
"dd->config.elem_array.elems.");