context FEATURE ly_ctx_get_submodule functions
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 597fc6e..03a2203 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -3637,7 +3637,7 @@
 {
     LY_ERR ret = LY_SUCCESS;
     struct yin_subelement *subelems = NULL;
-    struct lysp_submodule *dup;
+    const struct lysp_submodule *dup;
     size_t subelems_size;
 
     mod->is_submod = 0;
@@ -3680,7 +3680,7 @@
 
     /* submodules share the namespace with the module names, so there must not be
      * a submodule of the same name in the context, no need for revision matching */
-    dup = ly_ctx_get_submodule(ctx->xmlctx->ctx, NULL, mod->mod->name, NULL);
+    dup = ly_ctx_get_submodule_latest(ctx->xmlctx->ctx, mod->mod->name);
     if (dup) {
         LOGVAL_PARSER((struct lys_parser_ctx *)ctx, LY_VCODE_NAME2_COL, "module", "submodule", mod->mod->name);
         return LY_EVALID;
@@ -3703,7 +3703,7 @@
 {
     LY_ERR ret = LY_SUCCESS;
     struct yin_subelement *subelems = NULL;
-    struct lysp_submodule *dup;
+    const struct lysp_submodule *dup;
     size_t subelems_size;
 
     submod->is_submod = 1;
@@ -3745,7 +3745,7 @@
 
     /* submodules share the namespace with the module names, so there must not be
      * a submodule of the same name in the context, no need for revision matching */
-    dup = ly_ctx_get_submodule(ctx->xmlctx->ctx, NULL, submod->name, NULL);
+    dup = ly_ctx_get_submodule_latest(ctx->xmlctx->ctx, submod->name);
     if (dup && strcmp(dup->mod->name, submod->mod->name)) {
         LOGVAL_PARSER((struct lys_parser_ctx *)ctx, LY_VCODE_NAME_COL, "submodules", dup->name);
         return LY_EVALID;