device: support generating defines from devicetree nodes with no label

The existing code only worked for nodes that had a label property,
which is every device except ESP32 pinmux.  However, a label property
should not be necessary for defining a device from devicetree.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-12-21 15:25:06 -06:00 committed by Carles Cufí
commit 8c1bef535b

View file

@ -168,7 +168,8 @@ extern "C" {
*/
#define DEVICE_DT_DEFINE(node_id, init_fn, pm_control_fn, \
data_ptr, cfg_ptr, level, prio, api_ptr) \
Z_DEVICE_DEFINE(node_id, node_id, DT_LABEL(node_id), init_fn, \
Z_DEVICE_DEFINE(node_id, node_id, \
DT_PROP_OR(node_id, label, NULL), init_fn, \
pm_control_fn, \
data_ptr, cfg_ptr, level, prio, api_ptr)