tree schema FEATURE schema node module owner func
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 0dbfefa..67076b6 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -1222,6 +1222,17 @@
     return NULL;
 }
 
+API const struct lys_module *
+lysc_owner_module(const struct lysc_node *node)
+{
+    if (!node) {
+        return NULL;
+    }
+
+    for ( ; node->parent; node = node->parent) {}
+    return node->module;
+}
+
 API const char *
 lys_nodetype2str(uint16_t nodetype)
 {