]> git.sur5r.net Git - u-boot/commitdiff
dm: usb: Use blk_dread/write() instead of direct calls
authorSimon Glass <sjg@chromium.org>
Tue, 5 Jul 2016 23:10:17 +0000 (17:10 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 27 Jul 2016 20:15:54 +0000 (14:15 -0600)
Update the USB mass storage code to allow it to work with driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/usb_mass_storage.c

index b05913ac34464903bbc285f52b7a129843bbf5cf..86398fc24e8bf799887d46a60fb4b2b091cba98f 100644 (file)
@@ -22,7 +22,7 @@ static int ums_read_sector(struct ums *ums_dev,
        struct blk_desc *block_dev = &ums_dev->block_dev;
        lbaint_t blkstart = start + ums_dev->start_sector;
 
-       return block_dev->block_read(block_dev, blkstart, blkcnt, buf);
+       return blk_dread(block_dev, blkstart, blkcnt, buf);
 }
 
 static int ums_write_sector(struct ums *ums_dev,
@@ -31,7 +31,7 @@ static int ums_write_sector(struct ums *ums_dev,
        struct blk_desc *block_dev = &ums_dev->block_dev;
        lbaint_t blkstart = start + ums_dev->start_sector;
 
-       return block_dev->block_write(block_dev, blkstart, blkcnt, buf);
+       return blk_dwrite(block_dev, blkstart, blkcnt, buf);
 }
 
 static struct ums *ums;