init: set init_entry.dev to NULL

[PR#51217](https://github.com/zephyrproject-rtos/zephyr/pull/51217)
changed the `init_entry` structure, but `Z_INIT_ENTRY_NAME` (called
by `SYS_INIT` or `SYS_INIT_NAMED`) does not initialize all of the
members of the struct, leading to errors when building with
`-Werror=missing-field-initializers`.

Change the macro to initialize the `dev` member to `NULL` so that
all members of the struct are initialized.

Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
This commit is contained in:
Paul Fagerburg 2023-04-13 10:09:03 -06:00 committed by Anas Nashif
parent 76078ea63c
commit 04611a5735

View file

@ -154,6 +154,7 @@ struct init_entry {
Z_INIT_ENTRY_SECTION(level, prio) __used __noasan \
Z_INIT_ENTRY_NAME(name) = { \
.init_fn = {.sys = (init_fn_)}, \
.dev = NULL, \
}
/** @} */