devicetree.h: Covert DT_{REG,IRQ}_HAS_IDX macros to IS_ENABLED form
With the generation of DT_N_<node-id>_{REG,IRQ}_IDX_<idx>_EXISTS defines, we can now use the IS_ENABLED macro to implement DT_REG_HAS_IDX and DT_IRQ_HAS_IDX. This matches how other DT_*_HAS_* macros are implemented as well as lets us utilize these macros with COND_CODE_1. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
4e2ad00496
commit
df174ded13
1 changed files with 4 additions and 2 deletions
|
@ -655,7 +655,8 @@
|
|||
* @return 1 if "idx" is a valid register block index,
|
||||
* 0 otherwise.
|
||||
*/
|
||||
#define DT_REG_HAS_IDX(node_id, idx) ((idx) < DT_NUM_REGS(node_id))
|
||||
#define DT_REG_HAS_IDX(node_id, idx) \
|
||||
IS_ENABLED(DT_CAT(node_id, _REG_IDX_##idx##_EXISTS))
|
||||
|
||||
/**
|
||||
* @brief Get the base address of the register block at index "idx"
|
||||
|
@ -740,7 +741,8 @@
|
|||
* @return 1 if the idx is valid for the interrupt property
|
||||
* 0 otherwise.
|
||||
*/
|
||||
#define DT_IRQ_HAS_IDX(node_id, idx) ((idx) < DT_NUM_IRQS(node_id))
|
||||
#define DT_IRQ_HAS_IDX(node_id, idx) \
|
||||
IS_ENABLED(DT_CAT(node_id, _IRQ_IDX_##idx##_EXISTS))
|
||||
|
||||
/**
|
||||
* @brief Get a value within an interrupt specifier at an index
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue