schema tree BUGFIX case nodes should inherit config
diff --git a/src/schema_compile_node.c b/src/schema_compile_node.c
index 5e7d96da..fb2c96f 100644
--- a/src/schema_compile_node.c
+++ b/src/schema_compile_node.c
@@ -3625,17 +3625,8 @@
 static LY_ERR
 lys_compile_config(struct lysc_ctx *ctx, struct lysc_node *node, struct lysc_node *parent)
 {
-    if (node->nodetype == LYS_CASE) {
-        /* case never has any config */
-        assert(!(node->flags & LYS_CONFIG_MASK));
-        return LY_SUCCESS;
-    }
-
-    /* adjust parent to always get the ancestor with config */
-    if (parent && (parent->nodetype == LYS_CASE)) {
-        parent = parent->parent;
-        assert(parent);
-    }
+    /* case never has any explicit config */
+    assert((node->nodetype != LYS_CASE) || !(node->flags & LYS_CONFIG_MASK));
 
     if (ctx->options & (LYS_COMPILE_RPC_INPUT | LYS_COMPILE_RPC_OUTPUT)) {
         /* ignore config statements inside RPC/action data */
diff --git a/src/tree_schema.h b/src/tree_schema.h
index b9642c1..36afd4e 100644
--- a/src/tree_schema.h
+++ b/src/tree_schema.h
@@ -845,9 +845,9 @@
  *                                             1 1 1 1 1
  *     bit name              1 2 3 4 5 6 7 8 9 0 1 2 3 4
  *     ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *       1 LYS_CONFIG_W     |x|x|x|x|x|x| | | | | | | | |
+ *       1 LYS_CONFIG_W     |x|x|x|x|x|x|x| | | | | | | |
  *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *       2 LYS_CONFIG_R     |x|x|x|x|x|x| | | | | | | | |
+ *       2 LYS_CONFIG_R     |x|x|x|x|x|x|x| | | | | | | |
  *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  *       3 LYS_STATUS_CURR  |x|x|x|x|x|x|x|x|x|x|x|x| |x|
  *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+
diff --git a/tests/utests/schema/test_tree_schema_compile.c b/tests/utests/schema/test_tree_schema_compile.c
index c745546..58b2526 100644
--- a/tests/utests/schema/test_tree_schema_compile.c
+++ b/tests/utests/schema/test_tree_schema_compile.c
@@ -483,7 +483,7 @@
     cs = (struct lysc_node_case *)cs->next;
     assert_non_null(cs);
     assert_string_equal("b", cs->name);
-    assert_int_equal(LYS_STATUS_CURR | LYS_SET_DFLT, cs->flags);
+    assert_int_equal(LYS_STATUS_CURR | LYS_SET_DFLT | LYS_CONFIG_W, cs->flags);
     assert_ptr_equal(ch, cs->parent);
     assert_non_null(cs->child);
     assert_string_equal("b", cs->child->name);