From: Simon Glass <sjg@chromium.org>
Move the efi_exit() function further up the file and call it if the
board_init_r() function returns.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
lib/efi_client/efi_app.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
@@ -185,6 +185,14 @@ static void find_protocols(struct efi_priv *priv)
boot->locate_protocol(&guid, NULL, (void **)&priv->efi_dp_to_text);
}
+static void efi_exit(void)
+{
+ struct efi_priv *priv = efi_get_priv();
+
+ printf("U-Boot EFI exiting\n");
+ priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL);
+}
+
/**
* efi_main() - Start an EFI image
*
@@ -237,18 +245,11 @@ efi_status_t EFIAPI efi_main(efi_handle_t image,
gd = gd->new_gd;
board_init_r(NULL, 0);
free_memory(priv);
+ efi_exit();
return EFI_SUCCESS;
}
-static void efi_exit(void)
-{
- struct efi_priv *priv = efi_get_priv();
-
- printf("U-Boot EFI exiting\n");
- priv->boot->exit(priv->parent_image, EFI_SUCCESS, 0, NULL);
-}
-
static int efi_sysreset_request(struct udevice *dev, enum sysreset_t type)
{
struct efi_priv *priv = efi_get_priv();