Commit af06f8b7 authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki

ACPI / x86: Cleanup initrd related code

In arch/x86/kernel/setup.c, the #ifdef kept for CONFIG_ACPI actually is
related to the accessibility of initrd_start/initrd_end, so the stub should
be provided from this source file and should only be dependent on
CONFIG_BLK_DEV_INITRD.

Note that when ACPI=n and BLK_DEV_INITRD=y, early_initrd_acpi_init() is
still a stub because of the stub prepared for early_acpi_table_init().
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 5ae74f2c
...@@ -398,6 +398,11 @@ static void __init reserve_initrd(void) ...@@ -398,6 +398,11 @@ static void __init reserve_initrd(void)
memblock_free(ramdisk_image, ramdisk_end - ramdisk_image); memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
} }
static void __init early_initrd_acpi_init(void)
{
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
}
#else #else
static void __init early_reserve_initrd(void) static void __init early_reserve_initrd(void)
{ {
...@@ -405,6 +410,9 @@ static void __init early_reserve_initrd(void) ...@@ -405,6 +410,9 @@ static void __init early_reserve_initrd(void)
static void __init reserve_initrd(void) static void __init reserve_initrd(void)
{ {
} }
static void __init early_initrd_acpi_init(void)
{
}
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
static void __init parse_setup_data(void) static void __init parse_setup_data(void)
...@@ -1138,9 +1146,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -1138,9 +1146,7 @@ void __init setup_arch(char **cmdline_p)
reserve_initrd(); reserve_initrd();
#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD) early_initrd_acpi_init();
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
#endif
vsmp_init(); vsmp_init();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment