]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is disabled
authorLi Chen <chenl311@chinatelecom.cn>
Fri, 20 Jun 2025 13:13:07 +0000 (21:13 +0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 1 Jul 2025 14:06:51 +0000 (15:06 +0100)
If CONFIG_ACPI_SPCR_TABLE is disabled, acpi_parse_spcr()
currently returns 0, which may incorrectly suggest that
SPCR parsing was successful. This patch changes the behavior
to return -ENODEV to clearly indicate that SPCR support
is not available.

This prepares the codebase for future changes that depend
on acpi_parse_spcr() failure detection, such as suppressing
misleading console messages.

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Acked-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://lore.kernel.org/r/20250620131309.126555-2-me@linux.beauty
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
include/linux/acpi.h

index f102c0fe34318fd4070d9c9d10ecdc897d3ad8b9..71e692f952905e6b4578f1163648ee33ccae171d 100644 (file)
@@ -1503,7 +1503,7 @@ int acpi_parse_spcr(bool enable_earlycon, bool enable_console);
 #else
 static inline int acpi_parse_spcr(bool enable_earlycon, bool enable_console)
 {
-       return 0;
+       return -ENODEV;
 }
 #endif