Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/audio/chain_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,31 +458,34 @@ __cold static int chain_init(struct comp_dev *dev, void *addr, size_t length)
channel = cd->host_connector_node_id.f.v_index;
channel = dma_request_channel(cd->dma_host->z_dev, &channel);
if (channel < 0) {
comp_err(dev, "dma_request_channel() failed");
return -EINVAL;
comp_err(dev, "host dma_request_channel() failed for %u",
cd->host_connector_node_id.f.v_index);
Comment on lines +461 to +462
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the error code is irrelevant, it is -EINVAL always.

return channel;
}

cd->chan_host = &cd->dma_host->chan[channel];

err = dma_config(cd->dma_host->z_dev, cd->chan_host->index, dma_cfg_host);
if (err < 0) {
comp_err(dev, "dma_config() failed");
comp_err(dev, "host dma_config() failed for %d", channel);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

printing the 'channel' intentionally here, probably the error code can help, but I expect the underlying code to print on failure points

goto error_host;
}

/* get link DMA channel */
channel = cd->link_connector_node_id.f.v_index;
channel = dma_request_channel(cd->dma_link->z_dev, &channel);
if (channel < 0) {
comp_err(dev, "dma_request_channel() failed");
comp_err(dev, "link dma_request_channel() failed for %u",
cd->link_connector_node_id.f.v_index);
Comment on lines +478 to +479
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as for the first suggestion.

err = channel;
goto error_host;
}

cd->chan_link = &cd->dma_link->chan[channel];

err = dma_config(cd->dma_link->z_dev, cd->chan_link->index, dma_cfg_link);
if (err < 0) {
comp_err(dev, "dma_config() failed");
comp_err(dev, "link dma_config() failed for %d", channel);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, as intended

goto error_link;
}
return 0;
Expand Down
Loading