This patch splits acpi_table_init() into two steps. Since acpi_table_init() is used not just in x86, also used in ia64, we introduce two new functions: acpi_table_init_firmware() and acpi_table_init_override(), which work just the same as acpi_table_init() if they are called in sequence. This will keep acpi_table_init() works as before on other platforms, and we only call these new functions in Linux. Signed-off-by: Tang Chen <tangchen@xxxxxxxxxxxxxx> Reviewed-by: Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx> --- drivers/acpi/tables.c | 26 ++++++++++++++++++++------ include/linux/acpi.h | 2 ++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index c8f2d01..4913a85 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -336,6 +336,23 @@ static void __init check_multiple_madt(void) return; } +int __init acpi_table_init_firmware(void) +{ + acpi_status status; + + status = acpi_initialize_tables_firmware(initial_tables, + ACPI_MAX_TABLES, 0); + if (ACPI_FAILURE(status)) + return 1; + + return 0; +} + +void __init acpi_table_init_override(void) +{ + acpi_initialize_tables_override(); +} + /* * acpi_table_init() * @@ -347,16 +364,13 @@ static void __init check_multiple_madt(void) int __init acpi_table_init(void) { - acpi_status status; - - status = acpi_initialize_tables_firmware(initial_tables, - ACPI_MAX_TABLES, 0); - if (ACPI_FAILURE(status)) + if (acpi_table_init_firmware()) return 1; - acpi_initialize_tables_override(); + acpi_table_init_override(); check_multiple_madt(); + return 0; } diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 353ba25..9704179 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -95,6 +95,8 @@ void acpi_boot_table_init (void); int acpi_mps_check (void); int acpi_numa_init (void); +int acpi_table_init_firmware(void); +void acpi_table_init_override(void); int acpi_table_init (void); int acpi_table_parse(char *id, acpi_tbl_table_handler handler); int __init acpi_table_parse_entries(char *id, unsigned long table_size, -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html