mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
dm: dfu: mmc: Support CONFIG_BLK in DFU for MMC
Update the method of accessing the block device so that it works with CONFIG_BLK enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@ -49,7 +49,7 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dfu->data.mmc.hw_partition >= 0) {
|
if (dfu->data.mmc.hw_partition >= 0) {
|
||||||
part_num_bkp = mmc->block_dev.hwpart;
|
part_num_bkp = mmc_get_blk_desc(mmc)->hwpart;
|
||||||
ret = blk_select_hwpart_devnum(IF_TYPE_MMC,
|
ret = blk_select_hwpart_devnum(IF_TYPE_MMC,
|
||||||
dfu->data.mmc.dev_num,
|
dfu->data.mmc.dev_num,
|
||||||
dfu->data.mmc.hw_partition);
|
dfu->data.mmc.hw_partition);
|
||||||
@ -62,12 +62,11 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
|
|||||||
dfu->data.mmc.dev_num, blk_start, blk_count, buf);
|
dfu->data.mmc.dev_num, blk_start, blk_count, buf);
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case DFU_OP_READ:
|
case DFU_OP_READ:
|
||||||
n = mmc->block_dev.block_read(&mmc->block_dev, blk_start,
|
n = blk_dread(mmc_get_blk_desc(mmc), blk_start, blk_count, buf);
|
||||||
blk_count, buf);
|
|
||||||
break;
|
break;
|
||||||
case DFU_OP_WRITE:
|
case DFU_OP_WRITE:
|
||||||
n = mmc->block_dev.block_write(&mmc->block_dev, blk_start,
|
n = blk_dwrite(mmc_get_blk_desc(mmc), blk_start, blk_count,
|
||||||
blk_count, buf);
|
buf);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error("Operation not supported\n");
|
error("Operation not supported\n");
|
||||||
@ -356,7 +355,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
|
|||||||
|
|
||||||
} else if (!strcmp(entity_type, "part")) {
|
} else if (!strcmp(entity_type, "part")) {
|
||||||
disk_partition_t partinfo;
|
disk_partition_t partinfo;
|
||||||
struct blk_desc *blk_dev = &mmc->block_dev;
|
struct blk_desc *blk_dev = mmc_get_blk_desc(mmc);
|
||||||
int mmcdev = second_arg;
|
int mmcdev = second_arg;
|
||||||
int mmcpart = third_arg;
|
int mmcpart = third_arg;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user