diff options
author | Tom Rini <trini@konsulko.com> | 2023-06-16 19:05:52 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-06-16 19:05:52 -0400 |
commit | 1c30e10017ec8bcd0ffec0d8c7d17539ae73dfa7 (patch) | |
tree | 6120a7d1a99c25b50896a7d932d431145570f5a4 /lib/efi_selftest/efi_selftest_controllers.c | |
parent | 2f4664f5c3edc55b18d8906f256a4c8e303243c0 (diff) | |
parent | 5669591dd8d2b21bc79237b161107300eb7f2b12 (diff) |
Merge tag 'efi-2023-07-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2023-07-rc5
Documentation:
* man-page for imxtract
* correct EVT_DM_POST_INIT_F description
UEFI:
* bootm: don't call booti_setup for EFI images
* simplify efi_disk_remove
* fix tests that failed when executed repeatedly
Diffstat (limited to 'lib/efi_selftest/efi_selftest_controllers.c')
-rw-r--r-- | lib/efi_selftest/efi_selftest_controllers.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/efi_selftest/efi_selftest_controllers.c b/lib/efi_selftest/efi_selftest_controllers.c index d2bbd1c4f65..63e674bedc0 100644 --- a/lib/efi_selftest/efi_selftest_controllers.c +++ b/lib/efi_selftest/efi_selftest_controllers.c @@ -271,6 +271,8 @@ static int setup(const efi_handle_t img_handle, efi_status_t ret; boottime = systable->boottime; + handle_controller = NULL; + handle_driver = NULL; /* Create controller handle */ ret = boottime->install_protocol_interface( @@ -402,14 +404,36 @@ static int execute(void) /* Check number of child controllers */ ret = count_child_controllers(handle_controller, &guid_controller, &count); - if (ret == EFI_SUCCESS) + if (ret == EFI_SUCCESS || count) { efi_st_error("Uninstall failed\n"); + return EFI_ST_FAILURE; + } + + return EFI_ST_SUCCESS; } + /* + * Tear down unit test. + * + */ +static int teardown(void) +{ + efi_status_t ret; + /* Uninstall binding protocol */ + ret = boottime->uninstall_protocol_interface(handle_driver, + &guid_driver_binding_protocol, + &binding_interface); + if (ret != EFI_SUCCESS) + efi_st_error("Failed to uninstall protocols\n"); + + return ret; +} + EFI_UNIT_TEST(controllers) = { .name = "controllers", .phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT, .setup = setup, .execute = execute, + .teardown = teardown, }; |