diff options
author | Dan Williams <dan.j.williams@intel.com> | 2019-11-06 17:43:05 -0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-11-07 15:44:04 +0100 |
commit | 6950e31b35fdf4588cbbdec1813091bb02cf8871 (patch) | |
tree | e7ffd8d61e6140c3862926032c1ef3a343fd5d05 /drivers/firmware/efi | |
parent | fe3e5e65c06edb1c56e64e567f053e243142001f (diff) | |
download | linux-6950e31b35fdf4588cbbdec1813091bb02cf8871.tar.gz linux-6950e31b35fdf4588cbbdec1813091bb02cf8871.tar.bz2 linux-6950e31b35fdf4588cbbdec1813091bb02cf8871.zip |
x86/efi: Push EFI_MEMMAP check into leaf routines
In preparation for adding another EFI_MEMMAP dependent call that needs
to occur before e820__memblock_setup() fixup the existing efi calls to
check for EFI_MEMMAP internally. This ends up being cleaner than the
alternative of checking EFI_MEMMAP multiple times in setup_arch().
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/firmware/efi')
-rw-r--r-- | drivers/firmware/efi/esrt.c | 3 | ||||
-rw-r--r-- | drivers/firmware/efi/fake_mem.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c index d6dd5f503fa2..2762e0662bf4 100644 --- a/drivers/firmware/efi/esrt.c +++ b/drivers/firmware/efi/esrt.c @@ -246,6 +246,9 @@ void __init efi_esrt_init(void) int rc; phys_addr_t end; + if (!efi_enabled(EFI_MEMMAP)) + return; + pr_debug("esrt-init: loading.\n"); if (!esrt_table_exists()) return; diff --git a/drivers/firmware/efi/fake_mem.c b/drivers/firmware/efi/fake_mem.c index 9501edc0fcfb..526b45331d96 100644 --- a/drivers/firmware/efi/fake_mem.c +++ b/drivers/firmware/efi/fake_mem.c @@ -44,7 +44,7 @@ void __init efi_fake_memmap(void) void *new_memmap; int i; - if (!nr_fake_mem) + if (!efi_enabled(EFI_MEMMAP) || !nr_fake_mem) return; /* count up the number of EFI memory descriptor */ |