]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
efi: Set feature flags inside feature init functions
authorMatt Fleming <matt.fleming@intel.com>
Wed, 15 Jan 2014 13:36:33 +0000 (13:36 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 4 Mar 2014 16:16:16 +0000 (16:16 +0000)
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>
arch/x86/platform/efi/efi.c
drivers/firmware/efi/efi.c

index 8215629844522e4b6a0b3732a095e9fb218253f9..541e7db26c15d0954e42e9db2152a5147a527910 100644 (file)
@@ -577,6 +577,8 @@ static int __init efi_systab_init(void *phys)
                       efi.systab->hdr.revision >> 16,
                       efi.systab->hdr.revision & 0xffff);
 
+       set_bit(EFI_SYSTEM_TABLES, &efi.flags);
+
        return 0;
 }
 
@@ -612,6 +614,8 @@ static int __init efi_runtime_init(void)
        efi.get_time = phys_efi_get_time;
        early_iounmap(runtime, sizeof(efi_runtime_services_t));
 
+       set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
+
        return 0;
 }
 
@@ -629,6 +633,8 @@ static int __init efi_memmap_init(void)
        if (add_efi_memmap)
                do_add_efi_memmap();
 
+       set_bit(EFI_MEMMAP, &efi.flags);
+
        return 0;
 }
 
@@ -739,8 +745,6 @@ void __init efi_init(void)
        if (efi_config_init(arch_tables))
                return;
 
-       set_bit(EFI_CONFIG_TABLES, &efi.flags);
-
        /*
         * Note: We currently don't support runtime services on an EFI
         * that doesn't match the kernel 32/64-bit mode.
@@ -751,7 +755,6 @@ void __init efi_init(void)
        else {
                if (disable_runtime || efi_runtime_init())
                        return;
-               set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
        }
        if (efi_memmap_init())
                return;
@@ -1194,7 +1197,7 @@ static int __init parse_efi_cmdline(char *str)
                str++;
 
        if (!strncmp(str, "old_map", 7))
-               set_bit(EFI_OLD_MEMMAP, &x86_efi_facility);
+               set_bit(EFI_OLD_MEMMAP, &efi.flags);
 
        return 0;
 }
index 4753bac652798501cc79caeb50bd6c9ebd2b2dd3..b25b36b1ef23241ed311abdc949c74857cbdbf32 100644 (file)
@@ -313,5 +313,8 @@ int __init efi_config_init(efi_config_table_type_t *arch_tables)
        }
        pr_cont("\n");
        early_iounmap(config_tables, efi.systab->nr_tables * sz);
+
+       set_bit(EFI_CONFIG_TABLES, &efi.flags);
+
        return 0;
 }