From cf268c39a2d64748bae70de9471648ec3eb59dd7 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Mon, 3 Dec 2018 09:04:21 -0800 Subject: [PATCH] kernel: add note in device.h DEVICE_AND_API_INIT() is preferred over DEVICE_INIT() since DEVICE_INIT() does not set the API struct at build time. Signed-off-by: Andrew Boie --- include/device.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/device.h b/include/device.h index eca994a9717..ee764227888 100644 --- a/include/device.h +++ b/include/device.h @@ -36,7 +36,10 @@ extern "C" { * @brief Create device object and set it up for boot time initialization. * * @details This macro defines a device object that is automatically - * configured by the kernel during system initialization. + * configured by the kernel during system initialization. Note that + * devices set up with this macro will not be accessible from user mode + * since the API is not specified; whenever possible, use DEVICE_AND_API_INIT + * instead. * * @param dev_name Device name. This must be less than Z_DEVICE_MAX_NAME_LEN * characters in order to be looked up from user mode with device_get_binding().