summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/libstub/x86-stub.c
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-04-30 21:28:41 +0300
committerArd Biesheuvel <ardb@kernel.org>2020-05-01 10:40:02 +0300
commitf61900fd0ebf6c6b91719d63272a54f4d11051df (patch)
tree14464361c5634822f2ff072e3374053ac7a4b274 /drivers/firmware/efi/libstub/x86-stub.c
parent987053a30016a7d9ab3e4ad973e7c51aeb1f1ef6 (diff)
downloadlinux-f61900fd0ebf6c6b91719d63272a54f4d11051df.tar.xz
efi/libstub: Unify initrd loading across architectures
Factor out the initrd loading into a common function that can be called both from the generic efi-stub.c and the x86-specific x86-stub.c. Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Link: https://lore.kernel.org/r/20200430182843.2510180-10-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/x86-stub.c')
-rw-r--r--drivers/firmware/efi/libstub/x86-stub.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index defeb6035109..f1a134596b53 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -755,17 +755,8 @@ unsigned long efi_main(efi_handle_t handle,
if (!efi_noinitrd) {
unsigned long addr, size;
- status = efi_load_initrd_dev_path(&addr, &size, ULONG_MAX);
- if (status == EFI_NOT_FOUND) {
- if (efi_is_native() && image != NULL) {
- status = efi_load_initrd(image, &addr, &size,
- hdr->initrd_addr_max,
- ULONG_MAX);
- } else {
- addr = size = 0;
- status = EFI_SUCCESS;
- }
- }
+ status = efi_load_initrd(image, &addr, &size,
+ hdr->initrd_addr_max, ULONG_MAX);
if (status != EFI_SUCCESS) {
efi_err("Failed to load initrd!\n");