From 14860d8a97cfe90783a836f9ea56a977d156fda4 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 15 Dec 2021 11:49:49 +0100 Subject: [PATCH] devicetree: add DT_INST_PARENT helper Provide the instance based version of the DT_PARENT macro. Signed-off-by: Gerard Marull-Paretas --- include/devicetree.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/devicetree.h b/include/devicetree.h index e75fc083248..8635835315e 100644 --- a/include/devicetree.h +++ b/include/devicetree.h @@ -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 *