[PATCH RESEND 34/62] init: inline create_dev into the only caller

Askar Safin
2025-09-13T01:17:20Z

This is cleanup after initrd removal

Signed-off-by: Askar Safin <safinaskar@gmail.com>
---
init/do_mounts.c | 5 ++++-
init/do_mounts.h | 6 ------
2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 5c407ca54063..60ba8a633d32 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -366,7 +366,10 @@ static int __init mount_nodev_root(char *root_device_name)
#ifdef CONFIG_BLOCK
static void __init mount_block_root(char *root_device_name)
{
- int err = create_dev("/dev/root", ROOT_DEV);
+ int err;
+
+ init_unlink("/dev/root");
+ err = init_mknod("/dev/root", S_IFBLK | 0600, new_encode_dev(ROOT_DEV));

if (err < 0)
pr_emerg("Failed to create /dev/root: %d\n", err);
diff --git a/init/do_mounts.h b/init/do_mounts.h
index 6c7a535e71ce..f3df9d697304 100644
--- a/init/do_mounts.h
+++ b/init/do_mounts.h
@@ -16,12 +16,6 @@ void mount_root_generic(char *name, char *pretty_name, int flags);
void mount_root(char *root_device_name);
extern int root_mountflags;

-static inline __init int create_dev(char *name, dev_t dev)
-{
- init_unlink(name);
- return init_mknod(name, S_IFBLK | 0600, new_encode_dev(dev));
-}
-
/* Ensure that async file closing finished to prevent spurious errors. */
static inline void init_flush_fput(void)
{
--
2.47.2