devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an undesirable API for the following reasons: - it's inconsistent with the rest of the DT_NODE_HAS_FOO names - DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand for macros which are equivalent to DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) && - DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck - DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway - it is seen as a somewhat aesthetically challenged name Replace all users with DT_NODE_HAS_STATUS(..., okay), which is semantically equivalent. This is mostly done with sed, but a few remaining cases were done by hand, along with whitespace, docs, and comment changes. These special cases include the Nordic SOC static assert files. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
4f16b419e8
commit
6e8775ff84
184 changed files with 968 additions and 1010 deletions
|
@ -826,7 +826,7 @@ static int mcp2515_init(struct device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(0))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay)
|
||||
|
||||
static K_THREAD_STACK_DEFINE(mcp2515_int_thread_stack,
|
||||
CONFIG_CAN_MCP2515_INT_THREAD_STACK_SIZE);
|
||||
|
@ -864,4 +864,4 @@ DEVICE_AND_API_INIT(can_mcp2515_1, DT_INST_LABEL(0), &mcp2515_init,
|
|||
&mcp2515_data_1, &mcp2515_config_1, POST_KERNEL,
|
||||
CONFIG_CAN_MCP2515_INIT_PRIORITY, &can_api_funcs);
|
||||
|
||||
#endif /* DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(0)) */
|
||||
#endif /* DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay) */
|
||||
|
|
|
@ -656,7 +656,7 @@ static const struct can_driver_api mcux_flexcan_driver_api = {
|
|||
.register_state_change_isr = mcux_flexcan_register_state_change_isr
|
||||
};
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(0))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay)
|
||||
static void mcux_flexcan_config_func_0(struct device *dev);
|
||||
|
||||
static const struct mcux_flexcan_config mcux_flexcan_config_0 = {
|
||||
|
@ -756,9 +756,9 @@ NET_DEVICE_INIT(socket_can_flexcan_0, SOCKET_CAN_NAME_1, socket_can_init_0,
|
|||
|
||||
#endif /* CONFIG_NET_SOCKETS_CAN */
|
||||
|
||||
#endif /* DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(0)) */
|
||||
#endif /* DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay) */
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(1))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(1), okay)
|
||||
static void mcux_flexcan_config_func_1(struct device *dev);
|
||||
|
||||
static const struct mcux_flexcan_config mcux_flexcan_config_1 = {
|
||||
|
@ -806,4 +806,4 @@ static void mcux_flexcan_config_func_1(struct device *dev)
|
|||
irq_enable(DT_INST_IRQ_BY_NAME(1, mb_0_15, irq));
|
||||
}
|
||||
|
||||
#endif /* DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(1)) */
|
||||
#endif /* DT_NODE_HAS_STATUS(DT_DRV_INST(1), okay) */
|
||||
|
|
|
@ -388,7 +388,7 @@ static int can_stm32_init(struct device *dev)
|
|||
const struct can_stm32_config *cfg = DEV_CFG(dev);
|
||||
struct can_stm32_data *data = DEV_DATA(dev);
|
||||
CAN_TypeDef *can = cfg->can;
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(can2))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(can2), okay)
|
||||
CAN_TypeDef *master_can = cfg->master_can;
|
||||
#endif
|
||||
struct device *clock;
|
||||
|
@ -429,7 +429,7 @@ static int can_stm32_init(struct device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(can2))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(can2), okay)
|
||||
master_can->FMR &= ~CAN_FMR_CAN2SB; /* Assign all filters to CAN2 */
|
||||
#endif
|
||||
|
||||
|
@ -1132,7 +1132,7 @@ NET_DEVICE_INIT(socket_can_stm32_1, SOCKET_CAN_NAME_1, socket_can_init_1,
|
|||
|
||||
#endif /* CONFIG_NET_SOCKETS_CAN */
|
||||
|
||||
#endif /* DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(can1)) */
|
||||
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(can1), okay) */
|
||||
|
||||
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(can2), st_stm32_can, okay)
|
||||
|
||||
|
@ -1215,4 +1215,4 @@ NET_DEVICE_INIT(socket_can_stm32_2, SOCKET_CAN_NAME_2, socket_can_init_2,
|
|||
|
||||
#endif /* CONFIG_NET_SOCKETS_CAN */
|
||||
|
||||
#endif /* DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(can2)) */
|
||||
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(can2), okay) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue