From: Jon Hunter Date: Thu, 1 May 2025 12:46:21 +0000 (+0100) Subject: ACPI: APEI: EINJ: Fix probe error message X-Git-Tag: v6.16-rc1~161^2~1^5~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=368604c739cf25802f71edac16a0fcac97e4e671;p=thirdparty%2Flinux.git ACPI: APEI: EINJ: Fix probe error message Commit 6cb9441bfe8d ("ACPI: APEI: EINJ: Transition to the faux device interface") updated the APEI error injection driver to use the faux device interface and now for devices that don't support ACPI, the following error message is seen on boot: ERR KERN faux acpi-einj: probe did not succeed, tearing down the device The APEI error injection driver returns -ENODEV in the probe function if ACPI is not supported and so after transitioning the driver to the faux device interface, the error returned from the probe now causes the above error message to be displayed. Fix this by moving the code that detects if ACPI is supported to the einj_init() function to fix the false error message displayed for devices that don't support ACPI. Fixes: 6cb9441bfe8d ("ACPI: APEI: EINJ: Transition to the faux device interface") Signed-off-by: Jon Hunter Reviewed-by: Sudeep Holla Link: https://patch.msgid.link/20250501124621.1251450-1-jonathanh@nvidia.com Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 7ff334422899e..ea4fef3a9bb55 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -755,11 +755,6 @@ static int __init einj_probe(struct faux_device *fdev) acpi_status status; struct apei_exec_context ctx; - if (acpi_disabled) { - pr_debug("ACPI disabled.\n"); - return -ENODEV; - } - status = acpi_get_table(ACPI_SIG_EINJ, 0, (struct acpi_table_header **)&einj_tab); if (status == AE_NOT_FOUND) { @@ -886,6 +881,11 @@ static struct faux_device_ops einj_device_ops __refdata = { static int __init einj_init(void) { + if (acpi_disabled) { + pr_debug("ACPI disabled.\n"); + return -ENODEV; + } + einj_dev = faux_device_create("acpi-einj", NULL, &einj_device_ops); if (!einj_dev) return -ENODEV;