Skip to content

Commit aa240e2

Browse files
tristan-googlekartben
authored andcommitted
device: Update Z_DEVICE_INIT_ENTRY_DEFINE to be C++ compatible
The `Z_DEVICE_INIT_ENTRY_DEFINE()` macro uses a designated initializer to define a struct. Ensure all members of `struct init_entry` are defined in order for C++ compatibility. Signed-off-by: Tristan Honscheid <honscheid@google.com>
1 parent be4334b commit aa240e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/zephyr/device.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,8 @@ device_get_dt_nodelabels(const struct device *dev)
12411241
static const Z_DECL_ALIGN(struct init_entry) __used __noasan Z_INIT_ENTRY_SECTION( \
12421242
level, prio, Z_DEVICE_INIT_SUB_PRIO(node_id)) \
12431243
Z_INIT_ENTRY_NAME(DEVICE_NAME_GET(dev_id)) = { \
1244-
.dev = (const struct device *)&DEVICE_NAME_GET(dev_id) \
1244+
.init_fn = NULL, \
1245+
.dev = (const struct device *)&DEVICE_NAME_GET(dev_id), \
12451246
}
12461247

12471248
/**

0 commit comments

Comments
 (0)