Commit 66362c9a authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Catalin Marinas
Browse files

arm64: efi: fix initcall return values

Even though initcall return values are typically ignored, the
prototype is to return 0 on success or a negative errno value on
error. So fix the arm_enable_runtime_services() implementation to
return 0 on conditions that are not in fact errors, and return a
meaningful error code otherwise.

Signed-off-by: default avatarArd Biesheuvel <>
Reviewed-by: default avatarMatt Fleming <>
Acked-by: default avatarWill Deacon <>
Signed-off-by: Catalin Marinas's avatarCatalin Marinas <>
parent 81d94577
......@@ -280,12 +280,12 @@ static int __init arm64_enable_runtime_services(void)
if (!efi_enabled(EFI_BOOT)) {
pr_info("EFI services will not be available.\n");
return -1;
return 0;
if (efi_runtime_disabled()) {
pr_info("EFI runtime services will be disabled.\n");
return -1;
return 0;
pr_info("Remapping and enabling EFI services.\n");
......@@ -295,7 +295,7 @@ static int __init arm64_enable_runtime_services(void)
if (! {
pr_err("Failed to remap EFI memory map\n");
return -1;
return -ENOMEM;
memmap.map_end = + mapsize;
efi.memmap = &memmap;
......@@ -304,13 +304,13 @@ static int __init arm64_enable_runtime_services(void)
if (!efi.systab) {
pr_err("Failed to remap EFI System Table\n");
return -1;
return -ENOMEM;
set_bit(EFI_SYSTEM_TABLES, &efi.flags);
if (!efi_virtmap_init()) {
pr_err("No UEFI virtual mapping was installed -- runtime services will not be available\n");
return -1;
return -ENOMEM;
/* Set up runtime services function pointers */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment