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
|
@ -57,13 +57,13 @@ struct adc_hdl {
|
|||
* assume a semicolon separator.
|
||||
*/
|
||||
struct adc_hdl adc_list[] = {
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(0))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay)
|
||||
ADC_HDL_LIST_ENTRY(0),
|
||||
#endif
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(1))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(1), okay)
|
||||
ADC_HDL_LIST_ENTRY(1),
|
||||
#endif
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(2))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(2), okay)
|
||||
ADC_HDL_LIST_ENTRY(2),
|
||||
#endif
|
||||
};
|
||||
|
@ -473,13 +473,13 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_adc_cmds,
|
|||
*/
|
||||
SHELL_STATIC_SUBCMD_SET_CREATE(
|
||||
sub_adc,
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(0))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay)
|
||||
ADC_SHELL_COMMAND(0),
|
||||
#endif
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(1))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(1), okay)
|
||||
ADC_SHELL_COMMAND(1),
|
||||
#endif
|
||||
#if DT_HAS_NODE_STATUS_OKAY(DT_DRV_INST(2))
|
||||
#if DT_NODE_HAS_STATUS(DT_DRV_INST(2), okay)
|
||||
ADC_SHELL_COMMAND(2),
|
||||
#endif
|
||||
SHELL_SUBCMD_SET_END /* Array terminated. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue