Skip to content

Commit

Permalink
module_adapter: Propagate error from module specific callback
Browse files Browse the repository at this point in the history
When module_prepare() fails we need to return to calling module the
exact specific error not just -EIO.

There is no real use for Host AP to receive an error code that doesn't
reflect the actual error.

While at it, make the code more compact as suggested by Guennadi.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
  • Loading branch information
dbaluta committed Apr 13, 2023
1 parent ebaa142 commit c7e98ee
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,10 @@ int module_adapter_prepare(struct comp_dev *dev)
/* Prepare module */
ret = module_prepare(mod);
if (ret) {
if (ret == PPL_STATUS_PATH_STOP)
return ret;

comp_err(dev, "module_adapter_prepare() error %x: module prepare failed",
ret);

return -EIO;
if (ret != PPL_STATUS_PATH_STOP)
comp_err(dev, "module_adapter_prepare() error %x: module prepare failed",
ret);
return ret;
}

/* Get period_bytes first on prepare(). At this point it is guaranteed that the stream
Expand Down

0 comments on commit c7e98ee

Please sign in to comment.