[PATCH 06/16] efi: handle: build for both EFI payload and loader

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Dec 11 12:29:57 PST 2025


Since commit 387d6f9ed9a1 ("commands: provide efi_handle_dump in both
payload and loader"), drivers/efi/efi-handle.c is usable outside payload
as well, so move it into the efi/ directory.

While at it, drop the common.h header as it's only included header you
actually needed.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/efi/Makefile                     | 2 +-
 efi/Makefile                             | 2 +-
 drivers/efi/efi-handle.c => efi/handle.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename drivers/efi/efi-handle.c => efi/handle.c (97%)

diff --git a/drivers/efi/Makefile b/drivers/efi/Makefile
index 4e3c39e14486..8f0b43e70e45 100644
--- a/drivers/efi/Makefile
+++ b/drivers/efi/Makefile
@@ -1,3 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-y += efi-handle.o
+
 obj-$(CONFIG_EFI_PAYLOAD) += efi-device.o
diff --git a/efi/Makefile b/efi/Makefile
index 508c07c9b536..6693564f7071 100644
--- a/efi/Makefile
+++ b/efi/Makefile
@@ -3,4 +3,4 @@
 obj-$(CONFIG_EFI_PAYLOAD)	+= payload/
 obj-$(CONFIG_EFI_GUID)		+= guid.o
 obj-$(CONFIG_EFI_DEVICEPATH)	+= devicepath.o
-obj-y				+= errno.o efivar.o efivar-filename.o
+obj-y				+= errno.o handle.o efivar.o efivar-filename.o
diff --git a/drivers/efi/efi-handle.c b/efi/handle.c
similarity index 97%
rename from drivers/efi/efi-handle.c
rename to efi/handle.c
index 6485e97ded3f..d091d9e16514 100644
--- a/drivers/efi/efi-handle.c
+++ b/efi/handle.c
@@ -3,11 +3,11 @@
  * Copyright (c) 2014 Sascha Hauer <s.hauer at pengutronix.de>, Pengutronix
  */
 
-#include <common.h>
 #include <efi.h>
 #include <efi/efi-util.h>
 #include <efi/efi-device.h>
 #include <efi/efi-mode.h>
+#include <malloc.h>
 
 int __efi_locate_handle(struct efi_boot_services *bs,
 			enum efi_locate_search_type search_type,
-- 
2.47.3




More information about the barebox mailing list