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:
Martí Bolívar 2020-05-11 11:56:08 -07:00 committed by Carles Cufí
commit 6e8775ff84
184 changed files with 968 additions and 1010 deletions

View file

@ -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) */