pm: state: convert PM_STATE_INFO_DT_ITEM to standalone initializer

PM_STATE_INFO_DT_ITEM could not be used as a standalone initializer
since it had a trailing ',', making it an internal helper in practice.
This change renames the macro to PM_STATE_INFO_DT_INIT, and moves the
',' to the UTIL_LISTIFY helper.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-12-01 18:10:52 +01:00 committed by Anas Nashif
commit 68372aa562

View file

@ -167,8 +167,8 @@ struct pm_state_info {
* @return macro function to construct a pm_state_info
*/
#define Z_PM_STATE_INFO_DT_ITEMS_LISTIFY_FUNC(child, node_id) \
PM_STATE_INFO_DT_ITEM(DT_PHANDLE_BY_IDX(node_id, cpu_power_states, \
child))
PM_STATE_INFO_DT_INIT(DT_PHANDLE_BY_IDX(node_id, cpu_power_states, \
child)),
/**
* @brief Macro function to construct enum pm_state item in UTIL_LISTIFY
@ -184,18 +184,18 @@ struct pm_state_info {
/** @endcond */
/**
* @brief Construct a pm_state_info from a DT node identifier.
* @brief Initializer for struct pm_state_info given a DT node identifier with
* zephyr,power-state compatible.
*
* @param node_id A node identifier with compatible zephyr,power-state
* @return pm_state_info item for the given node.
*/
#define PM_STATE_INFO_DT_ITEM(node_id) \
#define PM_STATE_INFO_DT_INIT(node_id) \
{ \
.state = DT_ENUM_IDX(node_id, power_state_name), \
.substate_id = DT_PROP_OR(node_id, substate_id, 0), \
.min_residency_us = DT_PROP_OR(node_id, min_residency_us, 0), \
.exit_latency_us = DT_PROP_OR(node_id, exit_latency_us, 0), \
},
}
/**
* @brief Construct a pm_state enum from a DT node identifier.