Skip to content

Commit

Permalink
dai: add error log for failed path
Browse files Browse the repository at this point in the history
The error log is convenient for developer to check failed case in stress
test.

Signed-off-by: Rander Wang <rander.wang@intel.com>
  • Loading branch information
RanderWang authored and lgirdwood committed Jan 12, 2024
1 parent 8d2fb32 commit 705c614
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,11 @@ struct dai *dai_get(uint32_t type, uint32_t index, uint32_t flags)
struct dai *d;

dev = dai_get_zephyr_device(type, index);
if (!dev)
if (!dev) {
tr_err(&dai_tr, "dai_get: failed to get dai with index %d type %d",
index, type);
return NULL;
}

d = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(struct dai));
if (!d)
Expand All @@ -222,6 +225,8 @@ struct dai *dai_get(uint32_t type, uint32_t index, uint32_t flags)
dai_set_device_params(d);

if (dai_probe(d->dev)) {
tr_err(&dai_tr, "dai_get: failed to probe dai with index %d type %d",
index, type);
rfree(d);
return NULL;
}
Expand Down

0 comments on commit 705c614

Please sign in to comment.