Skip to content
Commit 6b61ec9d authored by Loic Domaigne's avatar Loic Domaigne Committed by Benjamin Cabé
Browse files

kernel: fix error propagation for device deferred initialization



This fix makes sure that do_device_init() returns a negative value if
the device's initialization failed. Previously, it mistakely returned
+errno instead of -errno.

This oversight happened during the refactoring of z_sys_init_run_level()
to support deferred initialization, from which most of do_device_init()
code derives. The rc value computed and stored in dev->state->init_res
is the POSITIVE value of the resulting errno. Returning rc therefore
breaks the convention of a negative value to signal failure.

Signed-off-by: default avatarLoic Domaigne <tech@domaigne.com>
parent 11431a80
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment