mirror of https://github.com/thesofproject/sof.git
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:
parent
3fc0e27b06
commit
6f26cfd8c4
|
@ -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.");
|
||||
|
|
Loading…
Reference in New Issue