module_adapter: Propagate error from module specific callback

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>
This commit is contained in:
Daniel Baluta 2023-04-07 18:57:46 +03:00 committed by Daniel Baluta
parent ebaa1429f9
commit c7e98ee731
1 changed files with 4 additions and 7 deletions

View File

@ -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