]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
efi_driver: return type of efi_driver_init()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 1 Feb 2018 11:53:32 +0000 (12:53 +0100)
committerAlexander Graf <agraf@suse.de>
Fri, 9 Feb 2018 23:24:00 +0000 (00:24 +0100)
Change the return type of efi_driver_init() to efi_status_t.

efi_driver_init() calls efi_add_driver() which returns an efi_status_t
value. efi_driver_init() should not subject this value to a conversion to
int losing high bits on 64bit systems.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/efi_loader.h
lib/efi_driver/efi_uclass.c

index 21c03c5c28f88560f4932feff51be25edcda7277..a2d82e1db737a5aad11bf1e7e506a4627115e61d 100644 (file)
@@ -272,7 +272,7 @@ efi_status_t efi_get_memory_map(efi_uintn_t *memory_map_size,
 uint64_t efi_add_memory_map(uint64_t start, uint64_t pages, int memory_type,
                            bool overlap_only_ram);
 /* Called by board init to initialize the EFI drivers */
-int efi_driver_init(void);
+efi_status_t efi_driver_init(void);
 /* Called by board init to initialize the EFI memory map */
 int efi_memory_init(void);
 /* Adds new or overrides configuration table entry to the system table */
index 90797f96d8d26e5ff8fc17d770ea9821cdae0709..46b69b479cb6beb4e6bf5ebe8888cfa933f594e9 100644 (file)
@@ -287,10 +287,10 @@ out:
  *
  * @return     0 = success, any other value will stop further execution
  */
-int efi_driver_init(void)
+efi_status_t efi_driver_init(void)
 {
        struct driver *drv;
-       int ret = 0;
+       efi_status_t ret = EFI_SUCCESS;
 
        /* Save 'gd' pointer */
        efi_save_gd();
@@ -300,7 +300,7 @@ int efi_driver_init(void)
             drv < ll_entry_end(struct driver, driver); ++drv) {
                if (drv->id == UCLASS_EFI) {
                        ret = efi_add_driver(drv);
-                       if (ret) {
+                       if (ret != EFI_SUCCESS) {
                                printf("EFI: ERROR: failed to add driver %s\n",
                                       drv->name);
                                break;