]> git.sur5r.net Git - u-boot/blobdiff - cmd/part.c
tools: kwbimage: Reduce scope of variables
[u-boot] / cmd / part.c
index 55995097eb00c8d1a12f03a621d2d29082b58b37..8ba05984e474921883462640b0b1479c5019251e 100644 (file)
 #include <part.h>
 #include <vsprintf.h>
 
-#ifndef CONFIG_PARTITION_UUIDS
-#error CONFIG_PARTITION_UUIDS must be enabled for CONFIG_CMD_PART to be enabled
-#endif
-
 static int do_part_uuid(int argc, char * const argv[])
 {
        int part;
-       block_dev_desc_t *dev_desc;
+       struct blk_desc *dev_desc;
        disk_partition_t info;
 
        if (argc < 2)
@@ -37,7 +33,7 @@ static int do_part_uuid(int argc, char * const argv[])
        if (argc > 3)
                return CMD_RET_USAGE;
 
-       part = get_device_and_partition(argv[0], argv[1], &dev_desc, &info, 0);
+       part = blk_get_device_part_str(argv[0], argv[1], &dev_desc, &info, 0);
        if (part < 0)
                return 1;
 
@@ -52,7 +48,7 @@ static int do_part_uuid(int argc, char * const argv[])
 static int do_part_list(int argc, char * const argv[])
 {
        int ret;
-       block_dev_desc_t *desc;
+       struct blk_desc *desc;
        char *var = NULL;
        bool bootable = false;
        int i;
@@ -81,7 +77,7 @@ static int do_part_list(int argc, char * const argv[])
                        return CMD_RET_USAGE;
        }
 
-       ret = get_device(argv[0], argv[1], &desc);
+       ret = blk_get_device_by_str(argv[0], argv[1], &desc);
        if (ret < 0)
                return 1;
 
@@ -92,7 +88,7 @@ static int do_part_list(int argc, char * const argv[])
 
                for (p = 1; p < 128; p++) {
                        char t[5];
-                       int r = get_partition_info(desc, p, &info);
+                       int r = part_get_info(desc, p, &info);
 
                        if (r != 0)
                                continue;
@@ -107,14 +103,14 @@ static int do_part_list(int argc, char * const argv[])
                return 0;
        }
 
-       print_part(desc);
+       part_print(desc);
 
        return 0;
 }
 
 static int do_part_start(int argc, char * const argv[])
 {
-       block_dev_desc_t *desc;
+       struct blk_desc *desc;
        disk_partition_t info;
        char buf[512] = { 0 };
        int part;
@@ -128,11 +124,11 @@ static int do_part_start(int argc, char * const argv[])
 
        part = simple_strtoul(argv[2], NULL, 0);
 
-       ret = get_device(argv[0], argv[1], &desc);
+       ret = blk_get_device_by_str(argv[0], argv[1], &desc);
        if (ret < 0)
                return 1;
 
-       err = get_partition_info(desc, part, &info);
+       err = part_get_info(desc, part, &info);
        if (err)
                return 1;
 
@@ -148,7 +144,7 @@ static int do_part_start(int argc, char * const argv[])
 
 static int do_part_size(int argc, char * const argv[])
 {
-       block_dev_desc_t *desc;
+       struct blk_desc *desc;
        disk_partition_t info;
        char buf[512] = { 0 };
        int part;
@@ -162,11 +158,11 @@ static int do_part_size(int argc, char * const argv[])
 
        part = simple_strtoul(argv[2], NULL, 0);
 
-       ret = get_device(argv[0], argv[1], &desc);
+       ret = blk_get_device_by_str(argv[0], argv[1], &desc);
        if (ret < 0)
                return 1;
 
-       err = get_partition_info(desc, part, &info);
+       err = part_get_info(desc, part, &info);
        if (err)
                return 1;