devicetree: add DT_INST_PARENT helper

Provide the instance based version of the DT_PARENT macro.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-12-15 11:49:49 +01:00 committed by David Leach
commit 14860d8a97

View file

@ -325,6 +325,13 @@
*/
#define DT_PARENT(node_id) UTIL_CAT(node_id, _PARENT)
/**
* @brief Get a DT_DRV_COMPAT parent's node identifier
* @param inst instance number
* @return a node identifier for the instance's parent
*/
#define DT_INST_PARENT(inst) DT_PARENT(DT_DRV_INST(inst))
/**
* @brief Get a node identifier for a grandparent node
*