Skip to content

Commit f64af1a

Browse files
ycsincfriedt
authored andcommitted
devicetree: use DT_CAT* wherever possible
Use `DT_CAT*` macros to paste simple things together instead of `UTIL_CAT` wherever possible. This should reduce the amount of error messages from the compiler when something goes wrong. Signed-off-by: Yong Cong Sin <[email protected]>
1 parent 2236e57 commit f64af1a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/zephyr/devicetree.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356
* @param node_id node identifier
357357
* @return a node identifier for the node's parent
358358
*/
359-
#define DT_PARENT(node_id) UTIL_CAT(node_id, _PARENT)
359+
#define DT_PARENT(node_id) DT_CAT(node_id, _PARENT)
360360

361361
/**
362362
* @brief Get a node identifier for a grandparent node
@@ -3087,7 +3087,7 @@
30873087
*/
30883088
#define DT_FOREACH_STATUS_OKAY(compat, fn) \
30893089
COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3090-
(UTIL_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
3090+
(DT_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
30913091
())
30923092

30933093
/**
@@ -3136,7 +3136,7 @@
31363136
*/
31373137
#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
31383138
COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3139-
(UTIL_CAT(DT_FOREACH_OKAY_VARGS_, \
3139+
(DT_CAT(DT_FOREACH_OKAY_VARGS_, \
31403140
compat)(fn, __VA_ARGS__)), \
31413141
())
31423142

@@ -4107,7 +4107,7 @@
41074107
* 0 otherwise
41084108
*/
41094109
#define DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(compat, bus) \
4110-
IS_ENABLED(UTIL_CAT(DT_CAT(DT_COMPAT_, compat), _BUS_##bus))
4110+
IS_ENABLED(DT_CAT4(DT_COMPAT_, compat, _BUS_, bus))
41114111

41124112
/**
41134113
* @brief Test if any `DT_DRV_COMPAT` node is on a bus of a given type

0 commit comments

Comments
 (0)