[Concept,09/22] cmd: part_find: Correct radix and calls

Message ID 20250925174753.3429102-10-sjg@u-boot.org
State New
Headers
Series efi: Tidy up some commands and provide a keyboard driver |

Commit Message

Simon Glass Sept. 25, 2025, 5:47 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Recent work removed the if_type member. Update the code to use the new
method for obtaining the interface type.

Use hex so that large partition numbers (>=10) work correctly.

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

 cmd/part_find.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/cmd/part_find.c b/cmd/part_find.c
index c39fce21e40..68b66569204 100644
--- a/cmd/part_find.c
+++ b/cmd/part_find.c
@@ -107,7 +107,7 @@  static int part_find(int argc, char *const argv[])
 								   &loader_part_no)) {
 						char env[256];
 
-						ret = snprintf(env, sizeof(env), "%s %d:%d", blk_get_if_type_name(desc->if_type), desc->devnum, loader_part_no);
+						ret = snprintf(env, sizeof(env), "%s %x:%x", blk_get_if_type_name(desc->if_type), desc->devnum, loader_part_no);
 						if (ret < 0 || ret == sizeof(env))
 							return CMD_RET_FAILURE;
 						if (env_set("target_part", env))
@@ -123,7 +123,7 @@  static int part_find(int argc, char *const argv[])
 						break;
 					if (strcasecmp(argv[1], info.type_guid) == 0) {
 						char env[256];
-						ret = snprintf(env, sizeof(env), "%s %d:%d", blk_get_if_type_name(desc->if_type), desc->devnum, i);
+						ret = snprintf(env, sizeof(env), "%s %x:%x", blk_get_uclass_name(desc->uclass_id), desc->devnum, i);
 						if (ret < 0 || ret == sizeof(env))
 							return CMD_RET_FAILURE;
 						env_set("target_part", env);