mirror of https://github.com/thesofproject/sof.git
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:
parent
ebaa1429f9
commit
c7e98ee731
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue