From: Li Chen Date: Fri, 20 Jun 2025 13:13:07 +0000 (+0800) Subject: ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is disabled X-Git-Tag: v6.15.11~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3a38cafa9c1cf42e41693547f765ce0857f5d6d;p=thirdparty%2Fkernel%2Fstable.git ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is disabled commit b9f58d3572a8e1ef707b941eae58ec4014b9269d upstream. 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 Acked-by: Hanjun Guo Link: https://lore.kernel.org/r/20250620131309.126555-2-me@linux.beauty Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/acpi.h b/include/linux/acpi.h index fc372bbaa5476..01c4c6e3924fc 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1491,7 +1491,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