]> Git Repo - J-u-boot.git/blobdiff - cmd/read.c
board: stm32mp1: Remove gpio_hog_probe_all() from board
[J-u-boot.git] / cmd / read.c
index 61d8ce73e4932172502a0d5dc09d6c1369a4f08c..99c7e3854e1ad9eb5211d9f788bae8c544ff3557 100644 (file)
 #include <command.h>
 #include <part.h>
 
-int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_read(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
        char *ep;
        struct blk_desc *dev_desc = NULL;
        int dev;
        int part = 0;
-       disk_partition_t part_info;
+       struct disk_partition part_info;
        ulong offset = 0u;
        ulong limit = 0u;
        void *addr;
@@ -30,13 +30,13 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                return 1;
        }
 
-       dev = (int)simple_strtoul(argv[2], &ep, 16);
+       dev = (int)hextoul(argv[2], &ep);
        if (*ep) {
                if (*ep != ':') {
                        printf("Invalid block device %s\n", argv[2]);
                        return 1;
                }
-               part = (int)simple_strtoul(++ep, NULL, 16);
+               part = (int)hextoul(++ep, NULL);
        }
 
        dev_desc = blk_get_dev(argv[1], dev);
@@ -45,9 +45,9 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                return 1;
        }
 
-       addr = (void *)simple_strtoul(argv[3], NULL, 16);
-       blk = simple_strtoul(argv[4], NULL, 16);
-       cnt = simple_strtoul(argv[5], NULL, 16);
+       addr = (void *)hextoul(argv[3], NULL);
+       blk = hextoul(argv[4], NULL);
+       cnt = hextoul(argv[5], NULL);
 
        if (part != 0) {
                if (part_get_info(dev_desc, part, &part_info)) {
@@ -66,7 +66,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                return 1;
        }
 
-       if (blk_read(dev_desc, offset + blk, cnt, addr) < 0) {
+       if (blk_dread(dev_desc, offset + blk, cnt, addr) != cnt) {
                printf("Error reading blocks\n");
                return 1;
        }
This page took 0.026901 seconds and 4 git commands to generate.