diff --git a/include/kernel/sysctl.h b/include/kernel/sysctl.h index 5b330f63cfcfedb130cf0e7f864bcc5f3fd86302..488dc2ea9b97403130bf2a8460b960bfd6e6ec64 100644 --- a/include/kernel/sysctl.h +++ b/include/kernel/sysctl.h @@ -68,7 +68,5 @@ void sysset_show_tree(struct sysset *sysset); struct sysobj *sysset_find_obj(struct sysset *sysset, const char *path); -int32_t sysctl_init(void); - #endif diff --git a/lib/sysctl.c b/lib/sysctl.c index 34412d54a38298c1cd016363bf9a79dd814fd5cd..2a37eca11977676373a4e63e097a6e577e83c764 100644 --- a/lib/sysctl.c +++ b/lib/sysctl.c @@ -52,6 +52,8 @@ #include <kernel/export.h> #include <kernel/string.h> +#include <kernel/init.h> + #include <errno.h> #include <list.h> @@ -560,7 +562,7 @@ void sysset_show_tree(struct sysset *sysset) * @brief initalises sysctl */ -int32_t sysctl_init(void) +static int sysctl_init(void) { if (sys_set) return -1; @@ -577,3 +579,4 @@ int32_t sysctl_init(void) return 0; } +subsys_initcall(sysctl_init);