aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2014-01-15 08:36:33 -0500
committerMatt Fleming <matt.fleming@intel.com>2014-03-04 11:16:16 -0500
commit0f8093a92da77afe24fd258a5a1037bb2b97a870 (patch)
treeacd0f1a2db891fb906e33014fc5356f0f4c80acd /arch/x86
parent3e909599215456928e6b42a04f11c2517881570b (diff)
efi: Set feature flags inside feature init functions
It makes more sense to set the feature flag in the success path of the detection function than it does to rely on the caller doing it. Apart from it being more logical to group the code and data together, it sets a much better example for new EFI architectures. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/platform/efi/efi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 821562984452..541e7db26c15 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -577,6 +577,8 @@ static int __init efi_systab_init(void *phys)
577 efi.systab->hdr.revision >> 16, 577 efi.systab->hdr.revision >> 16,
578 efi.systab->hdr.revision & 0xffff); 578 efi.systab->hdr.revision & 0xffff);
579 579
580 set_bit(EFI_SYSTEM_TABLES, &efi.flags);
581
580 return 0; 582 return 0;
581} 583}
582 584
@@ -612,6 +614,8 @@ static int __init efi_runtime_init(void)
612 efi.get_time = phys_efi_get_time; 614 efi.get_time = phys_efi_get_time;
613 early_iounmap(runtime, sizeof(efi_runtime_services_t)); 615 early_iounmap(runtime, sizeof(efi_runtime_services_t));
614 616
617 set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
618
615 return 0; 619 return 0;
616} 620}
617 621
@@ -629,6 +633,8 @@ static int __init efi_memmap_init(void)
629 if (add_efi_memmap) 633 if (add_efi_memmap)
630 do_add_efi_memmap(); 634 do_add_efi_memmap();
631 635
636 set_bit(EFI_MEMMAP, &efi.flags);
637
632 return 0; 638 return 0;
633} 639}
634 640
@@ -739,8 +745,6 @@ void __init efi_init(void)
739 if (efi_config_init(arch_tables)) 745 if (efi_config_init(arch_tables))
740 return; 746 return;
741 747
742 set_bit(EFI_CONFIG_TABLES, &efi.flags);
743
744 /* 748 /*
745 * Note: We currently don't support runtime services on an EFI 749 * Note: We currently don't support runtime services on an EFI
746 * that doesn't match the kernel 32/64-bit mode. 750 * that doesn't match the kernel 32/64-bit mode.
@@ -751,7 +755,6 @@ void __init efi_init(void)
751 else { 755 else {
752 if (disable_runtime || efi_runtime_init()) 756 if (disable_runtime || efi_runtime_init())
753 return; 757 return;
754 set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
755 } 758 }
756 if (efi_memmap_init()) 759 if (efi_memmap_init())
757 return; 760 return;
@@ -1194,7 +1197,7 @@ static int __init parse_efi_cmdline(char *str)
1194 str++; 1197 str++;
1195 1198
1196 if (!strncmp(str, "old_map", 7)) 1199 if (!strncmp(str, "old_map", 7))
1197 set_bit(EFI_OLD_MEMMAP, &x86_efi_facility); 1200 set_bit(EFI_OLD_MEMMAP, &efi.flags);
1198 1201
1199 return 0; 1202 return 0;
1200} 1203}