dd5e90ec6c
This changes the behavior of device_get_binding() so that it returns NULL if driver_api is not set. This provides a way for driver to state that it has not been initialized properly, and prevents app from using it since no reference to the device struct will be returned. This implements the idea specified in [1]. The idea is to reuse an existing resource by piggy-backing onto driver_api, thus avoiding an extra "device state" variable in the device struct. This differs from the code specified in the mailing list by checking driver_api for NULL first. This avoids the unnecessary strcmp() if driver_api is NULL. [1] https://lists.zephyrproject.org/archives/list/devel@lists.zephyrproject.org/message/MZB5PYBSRHV3NIEHJYXYQVLTPFIIHPB3/ Change-Id: I978b1a6683cd56c8a72532d6368c47e67515c82d Signed-off-by: Daniel Leung <daniel.leung@intel.com> |
||
---|---|---|
.. | ||
configs | ||
microkernel | ||
nanokernel | ||
Kconfig | ||
Makefile |