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

@ -20,7 +20,7 @@ LOG_MODULE_REGISTER(sdhc_spi, CONFIG_DISK_LOG_LEVEL);
/* Clock speed used after initialisation */
#define SDHC_SPI_SPEED 4000000
#if !DT_HAS_NODE_STATUS_OKAY(DT_INST(0, zephyr_mmc_spi_slot))
#if !DT_NODE_HAS_STATUS(DT_INST(0, zephyr_mmc_spi_slot), okay)
#warning NO SDHC slot specified on board
#else
struct sdhc_spi_data {

View file

@ -387,7 +387,7 @@ err_card_detect:
return err;
}
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(0))
#if DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay)
static struct stm32_sdmmc_priv stm32_sdmmc_priv_1 = {
.hsd = {
.Instance = (SDMMC_TypeDef *)DT_INST_REG_ADDR(0),

View file

@ -2705,7 +2705,7 @@ static int usdhc_access_init(const struct device *dev)
(void)k_mutex_lock(&z_usdhc_init_lock, K_FOREVER);
memset((char *)priv, 0, sizeof(struct usdhc_priv));
#if DT_HAS_NODE_STATUS_OKAY(DT_INST(0, nxp_imx_usdhc))
#if DT_NODE_HAS_STATUS(DT_INST(0, nxp_imx_usdhc), okay)
if (!strcmp(dev->name, DT_LABEL(DT_INST(0, nxp_imx_usdhc)))) {
priv->host_config.base =
(USDHC_Type *)DT_REG_ADDR(DT_INST(0, nxp_imx_usdhc));
@ -2721,7 +2721,7 @@ static int usdhc_access_init(const struct device *dev)
}
#endif
#if DT_HAS_NODE_STATUS_OKAY(DT_INST(1, nxp_imx_usdhc))
#if DT_NODE_HAS_STATUS(DT_INST(1, nxp_imx_usdhc), okay)
if (!strcmp(dev->name, DT_LABEL(DT_INST(1, nxp_imx_usdhc)))) {
priv->host_config.base =
(USDHC_Type *)DT_REG_ADDR(DT_INST(1, nxp_imx_usdhc));
@ -2876,7 +2876,7 @@ static int disk_usdhc_init(struct device *dev)
#ifdef CONFIG_DISK_ACCESS_USDHC1
static struct usdhc_priv usdhc_priv_1;
#if DT_HAS_NODE_STATUS_OKAY(DT_INST(0, nxp_imx_usdhc))
#if DT_NODE_HAS_STATUS(DT_INST(0, nxp_imx_usdhc), okay)
DEVICE_AND_API_INIT(usdhc_dev1,
DT_LABEL(DT_INST(0, nxp_imx_usdhc)), disk_usdhc_init,
&usdhc_priv_1, NULL, APPLICATION,
@ -2889,7 +2889,7 @@ DEVICE_AND_API_INIT(usdhc_dev1,
#ifdef CONFIG_DISK_ACCESS_USDHC2
static struct usdhc_priv usdhc_priv_2;
#if DT_HAS_NODE_STATUS_OKAY(DT_INST(1, nxp_imx_usdhc))
#if DT_NODE_HAS_STATUS(DT_INST(1, nxp_imx_usdhc), okay)
DEVICE_AND_API_INIT(usdhc_dev2,
DT_LABEL(DT_INST(1, nxp_imx_usdhc)), disk_usdhc_init,
usdhc_priv_2, NULL, APPLICATION,