]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - fs/ext4/dev.c
block: pass block dev not num to read/write/erase()
[people/ms/u-boot.git] / fs / ext4 / dev.c
index 20f52566f09c03bfeaa869855aa81649e109dc2c..9fd10de0776b82028c8ccdc547a03e6188eb5812 100644 (file)
@@ -76,10 +76,10 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
        if (byte_offset != 0) {
                int readlen;
                /* read first part which isn't aligned with start of sector */
-               if (ext4fs_block_dev_desc->
-                   block_read(ext4fs_block_dev_desc->dev,
-                               part_info->start + sector, 1,
-                               (unsigned long *) sec_buf) != 1) {
+               if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
+                                                     part_info->start + sector,
+                                                     1, (void *)sec_buf)
+                   != 1) {
                        printf(" ** ext2fs_devread() read error **\n");
                        return 0;
                }
@@ -101,18 +101,18 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
                ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_block_dev_desc->blksz);
 
                block_len = ext4fs_block_dev_desc->blksz;
-               ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc->dev,
+               ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
                                                  part_info->start + sector,
-                                                 1, (unsigned long *)p);
+                                                 1, (void *)p);
                memcpy(buf, p, byte_len);
                return 1;
        }
 
-       if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc->dev,
-                                              part_info->start + sector,
-                                              block_len >> log2blksz,
-                                              (unsigned long *) buf) !=
-                                              block_len >> log2blksz) {
+       if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
+                                             part_info->start + sector,
+                                             block_len >> log2blksz,
+                                             (void *)buf) !=
+                                             block_len >> log2blksz) {
                printf(" ** %s read error - block\n", __func__);
                return 0;
        }
@@ -123,10 +123,10 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
 
        if (byte_len != 0) {
                /* read rest of data which are not in whole sector */
-               if (ext4fs_block_dev_desc->
-                   block_read(ext4fs_block_dev_desc->dev,
-                               part_info->start + sector, 1,
-                               (unsigned long *) sec_buf) != 1) {
+               if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
+                                                     part_info->start + sector,
+                                                     1, (void *)sec_buf)
+                   != 1) {
                        printf("* %s read error - last part\n", __func__);
                        return 0;
                }