Skip to content

device: Update SYS_INIT_NAMED(), Z_DEVICE_INIT_ENTRY_DEFINE() to be C++ compatible #86957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/zephyr/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,8 @@ device_get_dt_nodelabels(const struct device *dev)
static const Z_DECL_ALIGN(struct init_entry) __used __noasan Z_INIT_ENTRY_SECTION( \
level, prio, Z_DEVICE_INIT_SUB_PRIO(node_id)) \
Z_INIT_ENTRY_NAME(DEVICE_NAME_GET(dev_id)) = { \
.dev = (const struct device *)&DEVICE_NAME_GET(dev_id) \
.init_fn = NULL, \
.dev = (const struct device *)&DEVICE_NAME_GET(dev_id), \
}

/**
Expand Down
2 changes: 1 addition & 1 deletion include/zephyr/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ struct init_entry {
#define SYS_INIT_NAMED(name, init_fn_, level, prio) \
static const Z_DECL_ALIGN(struct init_entry) \
Z_INIT_ENTRY_SECTION(level, prio, 0) __used __noasan \
Z_INIT_ENTRY_NAME(name) = {.init_fn = (init_fn_)} \
Z_INIT_ENTRY_NAME(name) = {.init_fn = (init_fn_), .dev = NULL} \

/** @} */

Expand Down
Loading