aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-11-23 02:43:24 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2015-11-26 13:15:54 -0500
commit66362c9afc1d4a806280b9e3646d2d0a26cf83e9 (patch)
tree1c7143665f8daf14d5b6e8eef0d395b2c83325e2
parent81d945772afccc77660374aa6e512184b9107580 (diff)
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: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r--arch/arm64/kernel/efi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index 96e4b1b7de46..4eeb17198cfa 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -280,12 +280,12 @@ static int __init arm64_enable_runtime_services(void)
280 280
281 if (!efi_enabled(EFI_BOOT)) { 281 if (!efi_enabled(EFI_BOOT)) {
282 pr_info("EFI services will not be available.\n"); 282 pr_info("EFI services will not be available.\n");
283 return -1; 283 return 0;
284 } 284 }
285 285
286 if (efi_runtime_disabled()) { 286 if (efi_runtime_disabled()) {
287 pr_info("EFI runtime services will be disabled.\n"); 287 pr_info("EFI runtime services will be disabled.\n");
288 return -1; 288 return 0;
289 } 289 }
290 290
291 pr_info("Remapping and enabling EFI services.\n"); 291 pr_info("Remapping and enabling EFI services.\n");
@@ -295,7 +295,7 @@ static int __init arm64_enable_runtime_services(void)
295 mapsize); 295 mapsize);
296 if (!memmap.map) { 296 if (!memmap.map) {
297 pr_err("Failed to remap EFI memory map\n"); 297 pr_err("Failed to remap EFI memory map\n");
298 return -1; 298 return -ENOMEM;
299 } 299 }
300 memmap.map_end = memmap.map + mapsize; 300 memmap.map_end = memmap.map + mapsize;
301 efi.memmap = &memmap; 301 efi.memmap = &memmap;
@@ -304,13 +304,13 @@ static int __init arm64_enable_runtime_services(void)
304 sizeof(efi_system_table_t)); 304 sizeof(efi_system_table_t));
305 if (!efi.systab) { 305 if (!efi.systab) {
306 pr_err("Failed to remap EFI System Table\n"); 306 pr_err("Failed to remap EFI System Table\n");
307 return -1; 307 return -ENOMEM;
308 } 308 }
309 set_bit(EFI_SYSTEM_TABLES, &efi.flags); 309 set_bit(EFI_SYSTEM_TABLES, &efi.flags);
310 310
311 if (!efi_virtmap_init()) { 311 if (!efi_virtmap_init()) {
312 pr_err("No UEFI virtual mapping was installed -- runtime services will not be available\n"); 312 pr_err("No UEFI virtual mapping was installed -- runtime services will not be available\n");
313 return -1; 313 return -ENOMEM;
314 } 314 }
315 315
316 /* Set up runtime services function pointers */ 316 /* Set up runtime services function pointers */