]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_driver: fix efi_uc_stop()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 9 Jan 2020 22:26:43 +0000 (23:26 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 14 Jan 2020 23:51:51 +0000 (00:51 +0100)
Use the correct protocol in efi_uc_stop() when detaching the driver from
the controller.

Change the block IO unit test for the block device driver to throw an error
instead of a todo if teardown fails.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_driver/efi_uclass.c
lib/efi_selftest/efi_selftest_block_device.c

index b14746e6b17683c757eaf594015163e996c52398..40269b00dc7b2d0711918872ae4fd8f3aaa79cf1 100644 (file)
@@ -197,7 +197,8 @@ static efi_status_t EFIAPI efi_uc_stop(
        efi_status_t ret;
        efi_uintn_t count;
        struct efi_open_protocol_info_entry *entry_buffer;
-       efi_guid_t *guid_controller = NULL;
+       struct efi_driver_binding_extended_protocol *bp =
+                       (struct efi_driver_binding_extended_protocol *)this;
 
        EFI_ENTRY("%p, %pUl, %zu, %p", this, controller_handle,
                  number_of_children, child_handle_buffer);
@@ -217,7 +218,7 @@ static efi_status_t EFIAPI efi_uc_stop(
 
        /* Destroy all children */
        ret = EFI_CALL(systab.boottime->open_protocol_information(
-                                       controller_handle, guid_controller,
+                                       controller_handle, bp->ops->protocol,
                                        &entry_buffer, &count));
        if (ret != EFI_SUCCESS)
                goto out;
@@ -237,7 +238,7 @@ static efi_status_t EFIAPI efi_uc_stop(
 
        /* Detach driver from controller */
        ret = EFI_CALL(systab.boottime->close_protocol(
-                       controller_handle, guid_controller,
+                       controller_handle, bp->ops->protocol,
                        this->driver_binding_handle, controller_handle));
 out:
        return EFI_EXIT(ret);
index 644c5ade213aa466316c731d49a31968af31b72d..d98a854e6d1a81d97762ce6d2f9e8508a291c8ec 100644 (file)
@@ -257,9 +257,9 @@ static int teardown(void)
                                disk_handle, &block_io_protocol_guid,
                                &block_io);
                if (r != EFI_SUCCESS) {
-                       efi_st_todo(
+                       efi_st_error(
                                "Failed to uninstall block I/O protocol\n");
-                       return EFI_ST_SUCCESS;
+                       return EFI_ST_FAILURE;
                }
        }