Skip to content

Commit 538eafc

Browse files
committed
LoongArch: Combine acpi_boot_table_init() and acpi_boot_init()
Combine acpi_boot_table_init() and acpi_boot_init() since they are very simple, and we don't need to check the return value of acpi_boot_init(). Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 83f638b commit 538eafc

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

arch/loongarch/kernel/acpi.c

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,6 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
5656
return ioremap_cache(phys, size);
5757
}
5858

59-
void __init acpi_boot_table_init(void)
60-
{
61-
/*
62-
* If acpi_disabled, bail out
63-
*/
64-
if (acpi_disabled)
65-
return;
66-
67-
/*
68-
* Initialize the ACPI boot-time table parser.
69-
*/
70-
if (acpi_table_init()) {
71-
disable_acpi();
72-
return;
73-
}
74-
}
75-
7659
#ifdef CONFIG_SMP
7760
static int set_processor_mask(u32 id, u32 flags)
7861
{
@@ -156,13 +139,21 @@ static void __init acpi_process_madt(void)
156139
loongson_sysconf.nr_cpus = num_processors;
157140
}
158141

159-
int __init acpi_boot_init(void)
142+
void __init acpi_boot_table_init(void)
160143
{
161144
/*
162145
* If acpi_disabled, bail out
163146
*/
164147
if (acpi_disabled)
165-
return -1;
148+
return;
149+
150+
/*
151+
* Initialize the ACPI boot-time table parser.
152+
*/
153+
if (acpi_table_init()) {
154+
disable_acpi();
155+
return;
156+
}
166157

167158
loongson_sysconf.boot_cpu_id = read_csr_cpuid();
168159

@@ -173,8 +164,6 @@ int __init acpi_boot_init(void)
173164

174165
/* Do not enable ACPI SPCR console by default */
175166
acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
176-
177-
return 0;
178167
}
179168

180169
#ifdef CONFIG_ACPI_NUMA

arch/loongarch/kernel/setup.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ void __init platform_init(void)
257257
#ifdef CONFIG_ACPI
258258
acpi_gbl_use_default_register_widths = false;
259259
acpi_boot_table_init();
260-
acpi_boot_init();
261260
#endif
262261

263262
#ifdef CONFIG_NUMA

0 commit comments

Comments
 (0)