public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH 2/2] efi_driver: use efi_close_protocol
Date: Mon, 10 Oct 2022 11:00:36 +0300	[thread overview]
Message-ID: <Y0PRJLg7Zk2joBxJ@hades> (raw)
In-Reply-To: <20221008071442.5963-3-heinrich.schuchardt@canonical.com>

On Sat, Oct 08, 2022 at 09:14:42AM +0200, Heinrich Schuchardt wrote:
> Avoid EFI_CALL() by using efi_close_protocol().
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  lib/efi_driver/efi_uclass.c | 25 +++++++++++--------------
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c
> index 45610d1aa3..45f9351988 100644
> --- a/lib/efi_driver/efi_uclass.c
> +++ b/lib/efi_driver/efi_uclass.c
> @@ -97,10 +97,9 @@ static efi_status_t EFIAPI efi_uc_supported(
>  
>  	ret = check_node_type(controller_handle);
>  
> -	r = EFI_CALL(systab.boottime->close_protocol(
> -				controller_handle, bp->ops->protocol,
> -				this->driver_binding_handle,
> -				controller_handle));
> +	r = efi_close_protocol(controller_handle, bp->ops->protocol,
> +			       this->driver_binding_handle,
> +			       controller_handle);
>  	if (r != EFI_SUCCESS)
>  		ret = EFI_UNSUPPORTED;
>  out:
> @@ -151,10 +150,9 @@ static efi_status_t EFIAPI efi_uc_start(
>  		goto out;
>  
>  err:
> -	r = EFI_CALL(systab.boottime->close_protocol(
> -			controller_handle, bp->ops->protocol,
> -			this->driver_binding_handle,
> -			controller_handle));
> +	r = efi_close_protocol(controller_handle, bp->ops->protocol,
> +			       this->driver_binding_handle,
> +			       controller_handle);
>  	if (r != EFI_SUCCESS)
>  		EFI_PRINT("Failure to close handle\n");
>  
> @@ -177,9 +175,8 @@ static efi_status_t disconnect_child(efi_handle_t controller_handle,
>  	efi_guid_t *guid_controller = NULL;
>  	efi_guid_t *guid_child_controller = NULL;
>  
> -	ret = EFI_CALL(systab.boottime->close_protocol(
> -				controller_handle, guid_controller,
> -				child_handle, child_handle));
> +	ret = efi_close_protocol(controller_handle, guid_controller,
> +				 child_handle, child_handle);
>  	if (ret != EFI_SUCCESS) {
>  		EFI_PRINT("Cannot close protocol\n");
>  		return ret;
> @@ -252,9 +249,9 @@ static efi_status_t EFIAPI efi_uc_stop(
>  		log_err("Cannot free EFI memory pool\n");
>  
>  	/* Detach driver from controller */
> -	ret = EFI_CALL(systab.boottime->close_protocol(
> -			controller_handle, bp->ops->protocol,
> -			this->driver_binding_handle, controller_handle));
> +	ret = efi_close_protocol(controller_handle, bp->ops->protocol,
> +				 this->driver_binding_handle,
> +				 controller_handle);
>  out:
>  	return EFI_EXIT(ret);
>  }
> -- 
> 2.37.2
> 
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


      reply	other threads:[~2022-10-10  8:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-08  7:14 [PATCH 0/2] efi_loader: internal CloseProtocol Heinrich Schuchardt
2022-10-08  7:14 ` [PATCH 1/2] " Heinrich Schuchardt
2022-10-10  8:00   ` Ilias Apalodimas
2022-10-08  7:14 ` [PATCH 2/2] efi_driver: use efi_close_protocol Heinrich Schuchardt
2022-10-10  8:00   ` Ilias Apalodimas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0PRJLg7Zk2joBxJ@hades \
    --to=ilias.apalodimas@linaro.org \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox