Commit 89d4f06c authored by Miika Karanki's avatar Miika Karanki Committed by Fabio Baltieri
Browse files

fs: remove not needed SYS_INIT function

fs_init was just initializing mutex and dlist. Those can be
done statically. Not having the SYS_INIT function helps
in ordering the init functions in case e.g. file system
mounts are wanted to happen early stage on the system
startup.

Signed-off-by: default avatarMiika Karanki <miika.karanki@vaisala.com>
parent 8a2a44f9
Loading
Loading
Loading
Loading
+2 −11
Changes for subsys/fs/fs.c: 2 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -22,10 +22,10 @@
LOG_MODULE_REGISTER(fs);

/* list of mounted file systems */
static sys_dlist_t fs_mnt_list;
static sys_dlist_t fs_mnt_list = SYS_DLIST_STATIC_INIT(&fs_mnt_list);

/* lock to protect mount list operations */
static struct k_mutex mutex;
static K_MUTEX_DEFINE(mutex);

/* Maps an identifier used in mount points to the file system
 * implementation.
@@ -875,12 +875,3 @@ int fs_unregister(int type, const struct fs_file_system_t *fs)
	LOG_DBG("fs unregister %d: %d", type, rc);
	return rc;
}

static int fs_init(void)
{
	k_mutex_init(&mutex);
	sys_dlist_init(&fs_mnt_list);
	return 0;
}

SYS_INIT(fs_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);