diff mbox series

[2/2] efi_loader: make efi_remove_protocol() static

Message ID 20230615065737.323329-2-ilias.apalodimas@linaro.org
State Superseded
Headers show
Series [1/2] efi_loader: use efi_install_multiple_protocol_interfaces() | expand

Commit Message

Ilias Apalodimas June 15, 2023, 6:57 a.m. UTC
A previous patch is removing the last consumer of efi_remove_protocol().
Switch that to static and treat it as an internal API in order to force
users install and remove protocols with the appropriate EFI functions.

It's worth noting that we still have files using efi_add_protocol().  We
should convert all these to efi_install_multiple_protocol_interfaces()
and treat efi_add_protocol() in a similar manner

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 include/efi_loader.h          | 4 ----
 lib/efi_loader/efi_boottime.c | 6 +++---
 2 files changed, 3 insertions(+), 7 deletions(-)

Comments

Heinrich Schuchardt June 18, 2023, 6:10 a.m. UTC | #1
On 6/15/23 08:57, Ilias Apalodimas wrote:
> A previous patch is removing the last consumer of efi_remove_protocol().
> Switch that to static and treat it as an internal API in order to force
> users install and remove protocols with the appropriate EFI functions.
>
> It's worth noting that we still have files using efi_add_protocol().  We
> should convert all these to efi_install_multiple_protocol_interfaces()
> and treat efi_add_protocol() in a similar manner
>
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
diff mbox series

Patch

diff --git a/include/efi_loader.h b/include/efi_loader.h
index 11e08a804f7f..90a2f72d6929 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -651,10 +651,6 @@  efi_status_t efi_protocol_open(struct efi_handler *handler,
 			       void **protocol_interface, void *agent_handle,
 			       void *controller_handle, uint32_t attributes);
 
-/* Delete protocol from a handle */
-efi_status_t efi_remove_protocol(const efi_handle_t handle,
-				 const efi_guid_t *protocol,
-				 void *protocol_interface);
 /* Install multiple protocol interfaces */
 efi_status_t EFIAPI
 efi_install_multiple_protocol_interfaces(efi_handle_t *handle, ...);
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index d5065f296aee..5006c0e1e4af 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -569,9 +569,9 @@  efi_status_t efi_search_protocol(const efi_handle_t handle,
  *
  * Return: status code
  */
-efi_status_t efi_remove_protocol(const efi_handle_t handle,
-				 const efi_guid_t *protocol,
-				 void *protocol_interface)
+static efi_status_t efi_remove_protocol(const efi_handle_t handle,
+					const efi_guid_t *protocol,
+					void *protocol_interface)
 {
 	struct efi_handler *handler;
 	efi_status_t ret;