Skip to content

Commit c7e98ee

Browse files
committed
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>
1 parent ebaa142 commit c7e98ee

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/audio/module_adapter/module_adapter.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,10 @@ int module_adapter_prepare(struct comp_dev *dev)
170170
/* Prepare module */
171171
ret = module_prepare(mod);
172172
if (ret) {
173-
if (ret == PPL_STATUS_PATH_STOP)
174-
return ret;
175-
176-
comp_err(dev, "module_adapter_prepare() error %x: module prepare failed",
177-
ret);
178-
179-
return -EIO;
173+
if (ret != PPL_STATUS_PATH_STOP)
174+
comp_err(dev, "module_adapter_prepare() error %x: module prepare failed",
175+
ret);
176+
return ret;
180177
}
181178

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

0 commit comments

Comments
 (0)