]> Git Repo - J-u-boot.git/blobdiff - cmd/gpt.c
Merge tag 'v2023.10-rc4' into next
[J-u-boot.git] / cmd / gpt.c
index 8969efba8c807e4a87a92a299286582b55620219..3cc6436b28b07aeab2c046d1f97b80c9297dba60 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -689,12 +689,13 @@ static int gpt_enumerate(struct blk_desc *desc)
                int ret;
                int i;
 
+               if (part_drv->test(desc))
+                       continue;
+
                for (i = 1; i < part_drv->max_entries; i++) {
                        ret = part_drv->get_info(desc, i, &pinfo);
-                       if (ret) {
-                               /* no more entries in table */
-                               break;
-                       }
+                       if (ret)
+                               continue;
 
                        ptr = &part_list[str_len];
                        tmp_len = strlen((const char *)pinfo.name);
@@ -709,9 +710,10 @@ static int gpt_enumerate(struct blk_desc *desc)
                        /* One byte for space(" ") delimiter */
                        ptr[tmp_len] = ' ';
                }
+               if (*part_list)
+                       part_list[strlen(part_list) - 1] = 0;
+               break;
        }
-       if (*part_list)
-               part_list[strlen(part_list) - 1] = 0;
        debug("setenv gpt_partition_list %s\n", part_list);
 
        return env_set("gpt_partition_list", part_list);
@@ -740,7 +742,7 @@ static int gpt_setenv_part_variables(struct disk_partition *pinfo, int i)
        if (ret)
                goto fail;
 
-       ret = env_set_ulong("gpt_partition_entry", i);
+       ret = env_set_hex("gpt_partition_entry", i);
        if (ret)
                goto fail;
 
@@ -784,10 +786,8 @@ static int gpt_setenv(struct blk_desc *desc, const char *name)
 
                for (i = 1; i < part_drv->max_entries; i++) {
                        ret = part_drv->get_info(desc, i, &pinfo);
-                       if (ret) {
-                               /* no more entries in table */
-                               break;
-                       }
+                       if (ret)
+                               continue;
 
                        if (!strcmp(name, (const char *)pinfo.name)) {
                                /* match found, setup environment variables */
@@ -1058,8 +1058,6 @@ U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt,
        "      gpt_partition_name, gpt_partition_entry\n"
        " gpt enumerate mmc 0\n"
        "    - store list of partitions to gpt_partition_list environment variable\n"
-       " read <interface> <dev>\n"
-       "    - read GPT into a data structure for manipulation\n"
        " gpt guid <interface> <dev>\n"
        "    - print disk GUID\n"
        " gpt guid <interface> <dev> <varname>\n"
This page took 0.027115 seconds and 4 git commands to generate.