]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_mmc.c
block: pass block dev not num to read/write/erase()
[u-boot] / common / cmd_mmc.c
index a6b7313e4a44d1f895a6a9e2a55311b85bcf5487..6b5c1ac1109eb6e10c27ad7fb88ddd0e8a8fa2f8 100644 (file)
@@ -351,7 +351,7 @@ static int do_mmc_read(cmd_tbl_t *cmdtp, int flag,
        printf("\nMMC read: dev # %d, block # %d, count %d ... ",
               curr_device, blk, cnt);
 
-       n = mmc->block_dev.block_read(curr_device, blk, cnt, addr);
+       n = mmc->block_dev.block_read(&mmc->block_dev, blk, cnt, addr);
        /* flush cache after read */
        flush_cache((ulong)addr, cnt * 512); /* FIXME */
        printf("%d blocks read: %s\n", n, (n == cnt) ? "OK" : "ERROR");
@@ -383,7 +383,7 @@ static int do_mmc_write(cmd_tbl_t *cmdtp, int flag,
                printf("Error: card is write protected!\n");
                return CMD_RET_FAILURE;
        }
-       n = mmc->block_dev.block_write(curr_device, blk, cnt, addr);
+       n = mmc->block_dev.block_write(&mmc->block_dev, blk, cnt, addr);
        printf("%d blocks written: %s\n", n, (n == cnt) ? "OK" : "ERROR");
 
        return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
@@ -411,7 +411,7 @@ static int do_mmc_erase(cmd_tbl_t *cmdtp, int flag,
                printf("Error: card is write protected!\n");
                return CMD_RET_FAILURE;
        }
-       n = mmc->block_dev.block_erase(curr_device, blk, cnt);
+       n = mmc->block_dev.block_erase(&mmc->block_dev, blk, cnt);
        printf("%d blocks erased: %s\n", n, (n == cnt) ? "OK" : "ERROR");
 
        return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;