From 8c1bef535bffce3ef098b6bd2a707eae5c7fe839 Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Mon, 21 Dec 2020 15:25:06 -0600 Subject: [PATCH] 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 --- include/device.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/device.h b/include/device.h index 41c5df803dd..a6027c68bc7 100644 --- a/include/device.h +++ b/include/device.h @@ -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)