data tree FEATURE new utility function for getting data schema parent
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 437d639..a96ad4d 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -1689,3 +1689,13 @@
 {
     return lys_module_find_prefix((const struct lys_module*)private, prefix, prefix_len);
 }
+
+const struct lysc_node *
+lysc_data_parent(const struct lysc_node *schema)
+{
+    const struct lysc_node *parent;
+
+    for (parent = schema->parent; parent && (parent->nodetype & (LYS_CHOICE | LYS_CASE)); parent = parent->parent);
+
+    return parent;
+}