[PATCH RESEND 14/62] init: m68k, mips, powerpc, s390, sh: remove Root_RAM0

Askar Safin
2025-09-13T00:55:20Z

Root_RAM0 used to specify ramdisk as root device.
It means nothing now, so let's remove it

Signed-off-by: Askar Safin <safinaskar@gmail.com>
---
arch/m68k/kernel/uboot.c | 1 -
arch/mips/kernel/setup.c | 1 -
arch/powerpc/kernel/setup-common.c | 11 ++++-------
arch/powerpc/platforms/powermac/setup.c | 4 +---
arch/s390/kernel/setup.c | 2 --
arch/sh/kernel/setup.c | 4 +---
include/linux/root_dev.h | 1 -
init/do_mounts.c | 2 --
8 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/arch/m68k/kernel/uboot.c b/arch/m68k/kernel/uboot.c
index fa7c279ead5d..d278060a250c 100644
--- a/arch/m68k/kernel/uboot.c
+++ b/arch/m68k/kernel/uboot.c
@@ -83,7 +83,6 @@ static void __init parse_uboot_commandline(char *commandp, int size)
(uboot_initrd_end > uboot_initrd_start)) {
initrd_start = uboot_initrd_start;
initrd_end = uboot_initrd_end;
- ROOT_DEV = Root_RAM0;
pr_info("initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
}
#endif /* if defined(CONFIG_BLK_DEV_INITRD) */
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 11b9b6b63e19..a78e24873231 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -173,7 +173,6 @@ static unsigned long __init init_initrd(void)
goto disable;
}

- ROOT_DEV = Root_RAM0;
return PFN_UP(end);
disable:
initrd_start = 0;
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 68d47c53876c..97d330f3b8f1 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -363,17 +363,14 @@ void __init check_for_initrd(void)
DBG(" -> check_for_initrd() initrd_start=0x%lx initrd_end=0x%lx\n",
initrd_start, initrd_end);

- /* If we were passed an initrd, set the ROOT_DEV properly if the values
- * look sensible. If not, clear initrd reference.
+ /* If we were not passed an sensible initramfs, clear initramfs reference.
*/
- if (is_kernel_addr(initrd_start) && is_kernel_addr(initrd_end) &&
- initrd_end > initrd_start)
- ROOT_DEV = Root_RAM0;
- else
+ if (!(is_kernel_addr(initrd_start) && is_kernel_addr(initrd_end) &&
+ initrd_end > initrd_start))
initrd_start = initrd_end = 0;

if (initrd_start)
- pr_info("Found initrd at 0x%lx:0x%lx\n", initrd_start, initrd_end);
+ pr_info("Found initramfs at 0x%lx:0x%lx\n", initrd_start, initrd_end);

DBG(" <- check_for_initrd()\n");
#endif /* CONFIG_BLK_DEV_INITRD */
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index eb092f293113..237d8386a3f4 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -296,9 +296,7 @@ static void __init pmac_setup_arch(void)
#endif
#ifdef CONFIG_PPC32
#ifdef CONFIG_BLK_DEV_INITRD
- if (initrd_start)
- ROOT_DEV = Root_RAM0;
- else
+ if (!initrd_start)
#endif
ROOT_DEV = DEFAULT_ROOT_DEVICE;
#endif
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 7b529868789f..a4ce721b7fe8 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -923,8 +923,6 @@ void __init setup_arch(char **cmdline_p)
/* boot_command_line has been already set up in early.c */
*cmdline_p = boot_command_line;

- ROOT_DEV = Root_RAM0;
-
setup_initial_init_mm(_text, _etext, _edata, _end);

if (IS_ENABLED(CONFIG_EXPOLINE_AUTO))
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 50f1d39fe34f..c4312ee13db9 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -147,10 +147,8 @@ void __init check_for_initrd(void)

/*
* If we got this far in spite of the boot loader's best efforts
- * to the contrary, assume we actually have a valid initrd and
- * fix up the root dev.
+ * to the contrary, assume we actually have a valid initramfs.
*/
- ROOT_DEV = Root_RAM0;

/*
* Address sanitization
diff --git a/include/linux/root_dev.h b/include/linux/root_dev.h
index 847c9a06101b..e411533b90b7 100644
--- a/include/linux/root_dev.h
+++ b/include/linux/root_dev.h
@@ -10,7 +10,6 @@ enum {
Root_NFS = MKDEV(UNNAMED_MAJOR, 255),
Root_CIFS = MKDEV(UNNAMED_MAJOR, 254),
Root_Generic = MKDEV(UNNAMED_MAJOR, 253),
- Root_RAM0 = MKDEV(RAMDISK_MAJOR, 0),
};

extern dev_t ROOT_DEV;
diff --git a/init/do_mounts.c b/init/do_mounts.c
index f0b1a83dbda4..5c407ca54063 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -437,8 +437,6 @@ static dev_t __init parse_root_device(char *root_device_name)
return Root_NFS;
if (strcmp(root_device_name, "/dev/cifs") == 0)
return Root_CIFS;
- if (strcmp(root_device_name, "/dev/ram") == 0)
- return Root_RAM0;

error = early_lookup_bdev(root_device_name, &dev);
if (error) {
--
2.47.2