device: remove support for deprecated init levels
EARLY, APPLICATION and SMP levels are no longer support for device drivers as 2 releases have happened since its deprecation. Add a validation macro so that compilation fails if the given level is not valid. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
07f3ac95be
commit
cfe5bd9224
2 changed files with 10 additions and 15 deletions
|
@ -32,6 +32,9 @@ API Changes
|
||||||
* Removed deprecated ``ceiling_fraction`` macro. :c:macro:`DIV_ROUND_UP` needs
|
* Removed deprecated ``ceiling_fraction`` macro. :c:macro:`DIV_ROUND_UP` needs
|
||||||
to be used now.
|
to be used now.
|
||||||
|
|
||||||
|
* Deprecated ``EARLY``, ``APPLICATION`` and ``SMP`` init levels can no longer be
|
||||||
|
used for devices.
|
||||||
|
|
||||||
Removed APIs in this release
|
Removed APIs in this release
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
|
|
@ -1075,24 +1075,16 @@ device_get_dt_nodelabels(const struct device *dev)
|
||||||
Z_DEVICE_SECTION_NAME(level, prio), DEVICE_NAME_GET(dev_id)) = \
|
Z_DEVICE_SECTION_NAME(level, prio), DEVICE_NAME_GET(dev_id)) = \
|
||||||
Z_DEVICE_INIT(name, pm, data, config, api, state, deps, node_id, dev_id)
|
Z_DEVICE_INIT(name, pm, data, config, api, state, deps, node_id, dev_id)
|
||||||
|
|
||||||
/* deprecated device initialization levels */
|
|
||||||
#define Z_DEVICE_LEVEL_DEPRECATED_EARLY \
|
|
||||||
__WARN("EARLY device driver level is deprecated")
|
|
||||||
#define Z_DEVICE_LEVEL_DEPRECATED_PRE_KERNEL_1
|
|
||||||
#define Z_DEVICE_LEVEL_DEPRECATED_PRE_KERNEL_2
|
|
||||||
#define Z_DEVICE_LEVEL_DEPRECATED_POST_KERNEL
|
|
||||||
#define Z_DEVICE_LEVEL_DEPRECATED_APPLICATION \
|
|
||||||
__WARN("APPLICATION device driver level is deprecated")
|
|
||||||
#define Z_DEVICE_LEVEL_DEPRECATED_SMP \
|
|
||||||
__WARN("SMP device driver level is deprecated")
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Issue a warning if the given init level is deprecated.
|
* @brief Issue an error if the given init level is not supported.
|
||||||
*
|
*
|
||||||
* @param level Init level
|
* @param level Init level
|
||||||
*/
|
*/
|
||||||
#define Z_DEVICE_LEVEL_CHECK_DEPRECATED_LEVEL(level) \
|
#define Z_DEVICE_CHECK_INIT_LEVEL(level) \
|
||||||
Z_DEVICE_LEVEL_DEPRECATED_##level
|
COND_CODE_1(Z_INIT_PRE_KERNEL_1_##level, (), \
|
||||||
|
(COND_CODE_1(Z_INIT_PRE_KERNEL_2_##level, (), \
|
||||||
|
(COND_CODE_1(Z_INIT_POST_KERNEL_##level, (), \
|
||||||
|
(ZERO_OR_COMPILE_ERROR(0)))))))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Define the init entry for a device.
|
* @brief Define the init entry for a device.
|
||||||
|
@ -1105,7 +1097,7 @@ device_get_dt_nodelabels(const struct device *dev)
|
||||||
* @param prio Initialization priority.
|
* @param prio Initialization priority.
|
||||||
*/
|
*/
|
||||||
#define Z_DEVICE_INIT_ENTRY_DEFINE(node_id, dev_id, init_fn_, level, prio) \
|
#define Z_DEVICE_INIT_ENTRY_DEFINE(node_id, dev_id, init_fn_, level, prio) \
|
||||||
Z_DEVICE_LEVEL_CHECK_DEPRECATED_LEVEL(level) \
|
Z_DEVICE_CHECK_INIT_LEVEL(level) \
|
||||||
\
|
\
|
||||||
static const Z_DECL_ALIGN(struct init_entry) __used __noasan Z_INIT_ENTRY_SECTION( \
|
static const Z_DECL_ALIGN(struct init_entry) __used __noasan Z_INIT_ENTRY_SECTION( \
|
||||||
level, prio, Z_DEVICE_INIT_SUB_PRIO(node_id)) \
|
level, prio, Z_DEVICE_INIT_SUB_PRIO(node_id)) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue