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 1/1] efi_loader: avoid using HandleProtocol in helloworld.efi
Date: Tue, 4 Apr 2023 10:35:31 +0300	[thread overview]
Message-ID: <ZCvTQ9X7Mo/bx8SZ@hera> (raw)
In-Reply-To: <20230404051748.23889-1-heinrich.schuchardt@canonical.com>

On Tue, Apr 04, 2023 at 07:17:48AM +0200, Heinrich Schuchardt wrote:
> HandleProtocol() is deprecated and leaves an OpenedProtocolInformation
> behind. Use OpenProtocol(GET_PROTOCOL) instead.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  lib/efi_loader/helloworld.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c
> index 49fa8cc2f0..6405f58ec3 100644
> --- a/lib/efi_loader/helloworld.c
> +++ b/lib/efi_loader/helloworld.c
> @@ -197,8 +197,10 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
>  	print_config_tables();
>
>  	/* Get the loaded image protocol */
> -	ret = boottime->handle_protocol(handle, &loaded_image_guid,
> -					(void **)&loaded_image);
> +	ret = boottime->open_protocol(handle, &loaded_image_guid,
> +				      (void **)&loaded_image, NULL, NULL,
> +				      EFI_OPEN_PROTOCOL_GET_PROTOCOL);
> +
>  	if (ret != EFI_SUCCESS) {
>  		con_out->output_string
>  			(con_out, u"Cannot open loaded image protocol\r\n");
> @@ -219,9 +221,10 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
>  			(con_out, u"Missing device handle\r\n");
>  		goto out;
>  	}
> -	ret = boottime->handle_protocol(loaded_image->device_handle,
> -					&device_path_guid,
> -					(void **)&device_path);
> +	ret = boottime->open_protocol(loaded_image->device_handle,
> +				      &device_path_guid,
> +				      (void **)&device_path, NULL, NULL,
> +				      EFI_OPEN_PROTOCOL_GET_PROTOCOL);
>  	if (ret != EFI_SUCCESS) {
>  		con_out->output_string
>  			(con_out, u"Missing device path for device handle\r\n");
> --
> 2.39.2
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>


      reply	other threads:[~2023-04-04  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04  5:17 [PATCH 1/1] efi_loader: avoid using HandleProtocol in helloworld.efi Heinrich Schuchardt
2023-04-04  7:35 ` 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=ZCvTQ9X7Mo/bx8SZ@hera \
    --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