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
|
@ -8,7 +8,7 @@
|
|||
#include <fsl_iomuxc.h>
|
||||
#include <fsl_gpio.h>
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(enet))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(enet), okay)
|
||||
static gpio_pin_config_t enet_gpio_config = {
|
||||
.direction = kGPIO_DigitalOutput,
|
||||
.outputLogic = 0,
|
||||
|
@ -34,7 +34,7 @@ static int mimxrt1020_evk_init(struct device *dev)
|
|||
/* SW0 */
|
||||
IOMUXC_SetPinMux(IOMUXC_SNVS_WAKEUP_GPIO5_IO00, 0);
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(lpuart1))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpuart1), okay)
|
||||
/* LPUART1 TX/RX */
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_06_LPUART1_TX, 0);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_07_LPUART1_RX, 0);
|
||||
|
@ -50,7 +50,7 @@ static int mimxrt1020_evk_init(struct device *dev)
|
|||
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
|
||||
#endif
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(lpuart2))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpuart2), okay)
|
||||
/* LPUART2 TX/RX */
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_08_LPUART2_TX, 0);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_09_LPUART2_RX, 0);
|
||||
|
@ -66,7 +66,7 @@ static int mimxrt1020_evk_init(struct device *dev)
|
|||
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
|
||||
#endif
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(lpi2c1))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c1), okay)
|
||||
/* LPI2C1 SCL, SDA */
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_14_LPI2C1_SCL, 1);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_15_LPI2C1_SDA, 1);
|
||||
|
@ -86,7 +86,7 @@ static int mimxrt1020_evk_init(struct device *dev)
|
|||
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
|
||||
#endif
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(lpi2c4))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c4), okay)
|
||||
/* LPI2C4 SCL, SDA */
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_02_LPI2C4_SCL, 1);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_03_LPI2C4_SDA, 1);
|
||||
|
@ -106,7 +106,7 @@ static int mimxrt1020_evk_init(struct device *dev)
|
|||
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
|
||||
#endif
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(enet))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(enet), okay)
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_04_GPIO1_IO04, 0U);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_06_GPIO1_IO22, 0U);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_10_ENET_RDATA00, 0);
|
||||
|
@ -147,7 +147,7 @@ static int mimxrt1020_evk_init(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(enet))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(enet), okay)
|
||||
static int mimxrt1020_evk_phy_reset(struct device *dev)
|
||||
{
|
||||
/* RESET PHY chip. */
|
||||
|
@ -159,6 +159,6 @@ static int mimxrt1020_evk_phy_reset(struct device *dev)
|
|||
#endif
|
||||
|
||||
SYS_INIT(mimxrt1020_evk_init, PRE_KERNEL_1, 0);
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_NODELABEL(enet))
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(enet), okay)
|
||||
SYS_INIT(mimxrt1020_evk_phy_reset, PRE_KERNEL_2, 0);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue