diff --git a/src/schema_compile.c b/src/schema_compile.c
index 5ae837a..f5da94c 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -1519,64 +1519,20 @@
     return ret;
 }
 
-LY_ERR
-lys_recompile(struct ly_ctx *ctx, ly_bool log)
-{
-    uint32_t idx;
-    struct lys_module *mod;
-    struct lys_glob_unres unres = {0};
-    LY_ERR ret = LY_SUCCESS;
-    uint32_t prev_lo = 0;
-
-    /* we are always recompiling all the modules */
-    unres.full_compilation = 1;
-
-    if (!log) {
-        /* recompile, must succeed because the modules were already compiled; hide messages because any
-         * warnings were already printed, are not really relevant, and would hide the real error */
-        prev_lo = ly_log_options(0);
-    }
-
-    /* free all the modules */
-    for (idx = 0; idx < ctx->list.count; ++idx) {
-        mod = ctx->list.objs[idx];
-        if (mod->compiled) {
-            assert(mod->implemented);
-
-            /* free the module */
-            lysc_module_free(mod->compiled);
-            mod->compiled = NULL;
-        }
-    }
-
-    /* recompile all the modules */
-    for (idx = 0; idx < ctx->list.count; ++idx) {
-        mod = ctx->list.objs[idx];
-        if (!mod->implemented || mod->compiled) {
-            /* nothing to do */
-            continue;
-        }
-
-        /* (re)compile the module */
-        LY_CHECK_GOTO(ret = lys_compile(mod, 0, &unres), cleanup);
-    }
-
-    /* resolve global unres */
-    LY_CHECK_GOTO(ret = lys_compile_unres_glob(ctx, &unres), cleanup);
-
-cleanup:
-    if (!log) {
-        ly_log_options(prev_lo);
-        if (ret) {
-            LOGERR(mod->ctx, ret, "Recompilation of module \"%s\" failed.", mod->name);
-        }
-    }
-    lys_compile_unres_glob_erase(ctx, &unres, 0);
-    return ret;
-}
-
-LY_ERR
-lys_compile(struct lys_module *mod, uint32_t options, struct lys_glob_unres *unres)
+/**
+ * @brief Compile schema into a validated schema linking all the references.
+ *
+ * Implemented flag of @p mod must be set meaning this function should be called only if the module
+ * is being recompiled, otherwise call ::lys_implement().
+ *
+ * @param[in] mod Pointer to the schema structure holding pointers to both schema structure types. The ::lys_module#parsed
+ * member is used as input and ::lys_module#compiled is used to hold the result of the compilation.
+ * @param[in,out] unres Global unres structure to add to.
+ * @return LY_SUCCESS on success.
+ * @return LY_ERR on error.
+ */
+static LY_ERR
+lys_compile(struct lys_module *mod, struct lys_glob_unres *unres)
 {
     struct lysc_ctx ctx = {0};
     struct lysc_module *mod_c = NULL;
@@ -1596,7 +1552,6 @@
     ctx.ctx = mod->ctx;
     ctx.cur_mod = mod;
     ctx.pmod = sp;
-    ctx.options = options;
     ctx.path_len = 1;
     ctx.path[0] = '/';
     ctx.unres = unres;
@@ -1701,6 +1656,62 @@
     return ret;
 }
 
+LY_ERR
+lys_recompile(struct ly_ctx *ctx, ly_bool log)
+{
+    uint32_t idx;
+    struct lys_module *mod;
+    struct lys_glob_unres unres = {0};
+    LY_ERR ret = LY_SUCCESS;
+    uint32_t prev_lo = 0;
+
+    /* we are always recompiling all the modules */
+    unres.full_compilation = 1;
+
+    if (!log) {
+        /* recompile, must succeed because the modules were already compiled; hide messages because any
+         * warnings were already printed, are not really relevant, and would hide the real error */
+        prev_lo = ly_log_options(0);
+    }
+
+    /* free all the modules */
+    for (idx = 0; idx < ctx->list.count; ++idx) {
+        mod = ctx->list.objs[idx];
+        if (mod->compiled) {
+            assert(mod->implemented);
+
+            /* free the module */
+            lysc_module_free(mod->compiled);
+            mod->compiled = NULL;
+        }
+    }
+
+    /* recompile all the modules */
+    for (idx = 0; idx < ctx->list.count; ++idx) {
+        mod = ctx->list.objs[idx];
+        if (!mod->implemented || mod->compiled) {
+            /* nothing to do */
+            continue;
+        }
+
+        /* (re)compile the module */
+        LY_CHECK_GOTO(ret = lys_compile(mod, &unres), cleanup);
+    }
+
+    /* resolve global unres */
+    LY_CHECK_GOTO(ret = lys_compile_unres_glob(ctx, &unres), cleanup);
+
+cleanup:
+    if (!log) {
+        ly_log_options(prev_lo);
+        if (ret) {
+            LOGERR(mod->ctx, ret, "Recompilation of module \"%s\" failed.", mod->name);
+        }
+    }
+    lys_compile_unres_glob_erase(ctx, &unres, 0);
+    return ret;
+}
+
 /**
  * @brief Check whether a module does not have any (recursive) compiled import.
  *
@@ -1788,7 +1799,7 @@
     }
 
     /* compile the schema */
-    LY_CHECK_RET(lys_compile(mod, 0, unres));
+    LY_CHECK_RET(lys_compile(mod, unres));
 
     /* new module is implemented and compiled */
     unres->full_compilation = 0;
diff --git a/src/schema_compile.h b/src/schema_compile.h
index d186fb0..a842210 100644
--- a/src/schema_compile.h
+++ b/src/schema_compile.h
@@ -276,21 +276,6 @@
 LY_ERR lys_recompile(struct ly_ctx *ctx, ly_bool log);
 
 /**
- * @brief Compile schema into a validated schema linking all the references.
- *
- * Implemented flag of @p mod must be set meaning this function should be called only if the module
- * is being recompiled, otherwise call ::lys_implement().
- *
- * @param[in] mod Pointer to the schema structure holding pointers to both schema structure types. The ::lys_module#parsed
- * member is used as input and ::lys_module#compiled is used to hold the result of the compilation.
- * @param[in] options Various options to modify compiler behavior, see [compile flags](@ref scflags).
- * @param[in,out] unres Global unres structure to add to.
- * @return LY_SUCCESS on success.
- * @return LY_ERR on error.
- */
-LY_ERR lys_compile(struct lys_module *mod, uint32_t options, struct lys_glob_unres *unres);
-
-/**
  * @brief Implement a single module, can be called recursively.
  *
  * @param[in] mod Module to implement.
diff --git a/tests/utests/schema/test_tree_schema_compile.c b/tests/utests/schema/test_tree_schema_compile.c
index 4992cc8..227f7d2 100644
--- a/tests/utests/schema/test_tree_schema_compile.c
+++ b/tests/utests/schema/test_tree_schema_compile.c
@@ -76,8 +76,6 @@
 
     str = "module test {namespace urn:test; prefix t;"
             "feature f1;feature f2 {if-feature f1;}}";
-    assert_int_equal(LY_EINVAL, lys_compile(NULL, 0, NULL));
-    CHECK_LOG("Invalid argument mod (lys_compile()).", NULL);
     assert_int_equal(LY_SUCCESS, ly_in_new_memory(str, &in));
     assert_int_equal(LY_SUCCESS, lys_parse_in(UTEST_LYCTX, in, LYS_IN_YANG, NULL, NULL, &unres.creating, &mod));
     lys_compile_unres_glob_erase(UTEST_LYCTX, &unres, 0);
