Skip to content

Commit 162457f

Browse files
djbwrafaeljw
authored andcommitted
ACPI: APEI: EINJ: Do not fail einj_init() on faux_device_create() failure
CXL has a symbol dependency on einj_core.ko, so if einj_init() fails then cxl_core.ko fails to load. Prior to the faux_device_create() conversion, einj_probe() failures were tracked by the einj_initialized flag without failing einj_init(). Revert to that behavior and always succeed einj_init() given there is no way, and no pressing need, to discern faux device-create vs device-probe failures. This situation arose because CXL knows proper kernel named objects to trigger errors against, but acpi-einj knows how to perform the error injection. The injection mechanism is shared with non-CXL use cases. The result is CXL now has a module dependency on einj-core.ko, and init/probe failures are handled at runtime. Fixes: 6cb9441 ("ACPI: APEI: EINJ: Transition to the faux device interface") Signed-off-by: Dan Williams <[email protected]> Reviewed-by: Ben Cheatham <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ff53a6e commit 162457f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/acpi/apei/einj-core.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -883,19 +883,16 @@ static int __init einj_init(void)
883883
}
884884

885885
einj_dev = faux_device_create("acpi-einj", NULL, &einj_device_ops);
886-
if (!einj_dev)
887-
return -ENODEV;
888886

889-
einj_initialized = true;
887+
if (einj_dev)
888+
einj_initialized = true;
890889

891890
return 0;
892891
}
893892

894893
static void __exit einj_exit(void)
895894
{
896-
if (einj_initialized)
897-
faux_device_destroy(einj_dev);
898-
895+
faux_device_destroy(einj_dev);
899896
}
900897

901898
module_init(einj_init);

0 commit comments

Comments
 (0)