[Concept,07/14] efi: Show the device name only with the EFI loader

Message ID 20250820144621.1073679-8-sjg@u-boot.org
State New
Headers
Series efi: app: Support booting an OS |

Commit Message

Simon Glass Aug. 20, 2025, 2:46 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

The 'efidebug dh' command dereferences a handle to obtain the device
name.

The format of an EFI handle is not defined by the spec, so when running
in the app we cannot assume that the handle can be dereferenced. Even if
the EFI provider happens to be U-Boot it might be a different version.

So don't try display the device name with the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 cmd/efidebug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index a6a0e877798..cec4165a5e1 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -489,7 +489,7 @@  static int do_efi_show_handles(struct cmd_tbl *cmdtp, int flag,
 		struct efi_handler *handler;
 
 		printf("\n%p", handle);
-		if (handle->dev)
+		if (!IS_ENABLED(CONFIG_EFI_APP) && handle->dev)
 			printf(" (%s)", handle->dev->name);
 		printf("\n");
 		/* Print device path */