Skip to content
Commit 1a7cd6dd authored by Peter Bigot's avatar Peter Bigot Committed by Carles Cufi
Browse files

kernel: device: invert sense of ready bit



The device status ready bit replaced the previous hack of clearing the
device API pointer when initialization of the device failed.  It
inadvertently changed the behavior of device_get_binding() when
invoked before the device was initialized: previously that succeeded
for uninitialized devices, after the change it failed.

Multiple driver initializations rely on being able to get a device
pointer for something they're going to depend on in their init
function, even if that device has not yet been initialized.  Although
this is wrong, and would cause faults if the device failed to
initialize before use, in practice it has been working.

It's not feasible to identify all the situations where this has
occurred, nor to add code to diagnose such cases without changing the
state associated with a device to distinguish initialized from
initialization success/failure.  Restore the previous behavior until a
more holistic solution is developed.

Signed-off-by: default avatarPeter Bigot <peter.bigot@nordicsemi.no>
parent c3eeab7b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment