summaryrefslogtreecommitdiff
path: root/drivers/dfu/dfu_nand.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-06-04 08:49:47 -0400
committerTom Rini <trini@konsulko.com>2016-06-04 08:49:47 -0400
commit715b3a9b2486e8d7a32365d817c77209b35ee796 (patch)
tree5daa126a15d2e0d60156664d19adbf451324d098 /drivers/dfu/dfu_nand.c
parentc41c649c2fdec7bf6ef84173597cc3feabdb7828 (diff)
parent667067faa18334f1e28c01b47530b5cce1b6182f (diff)
downloadu-boot-imx-715b3a9b2486e8d7a32365d817c77209b35ee796.zip
u-boot-imx-715b3a9b2486e8d7a32365d817c77209b35ee796.tar.gz
u-boot-imx-715b3a9b2486e8d7a32365d817c77209b35ee796.tar.bz2
Merge git://git.denx.de/u-boot-nand-flash
Diffstat (limited to 'drivers/dfu/dfu_nand.c')
-rw-r--r--drivers/dfu/dfu_nand.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index a975492..ab782be 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -25,7 +25,7 @@ static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
loff_t start, lim;
size_t count, actual;
int ret;
- nand_info_t *nand;
+ struct mtd_info *mtd;
/* if buf == NULL return total size of the area */
if (buf == NULL) {
@@ -39,16 +39,16 @@ static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
if (nand_curr_device < 0 ||
nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE ||
- !nand_info[nand_curr_device].name) {
+ !nand_info[nand_curr_device]->name) {
printf("%s: invalid nand device\n", __func__);
return -1;
}
- nand = &nand_info[nand_curr_device];
+ mtd = nand_info[nand_curr_device];
if (op == DFU_OP_READ) {
- ret = nand_read_skip_bad(nand, start, &count, &actual,
- lim, buf);
+ ret = nand_read_skip_bad(mtd, start, &count, &actual,
+ lim, buf);
} else {
nand_erase_options_t opts;
@@ -59,12 +59,12 @@ static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
opts.quiet = 1;
opts.lim = lim;
/* first erase */
- ret = nand_erase_opts(nand, &opts);
+ ret = nand_erase_opts(mtd, &opts);
if (ret)
return ret;
/* then write */
- ret = nand_write_skip_bad(nand, start, &count, &actual,
- lim, buf, WITH_WR_VERIFY);
+ ret = nand_write_skip_bad(mtd, start, &count, &actual,
+ lim, buf, WITH_WR_VERIFY);
}
if (ret != 0) {
@@ -142,24 +142,24 @@ static int dfu_flush_medium_nand(struct dfu_entity *dfu)
/* in case of ubi partition, erase rest of the partition */
if (dfu->data.nand.ubi) {
- nand_info_t *nand;
+ struct mtd_info *mtd;
nand_erase_options_t opts;
if (nand_curr_device < 0 ||
nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE ||
- !nand_info[nand_curr_device].name) {
+ !nand_info[nand_curr_device]->name) {
printf("%s: invalid nand device\n", __func__);
return -1;
}
- nand = &nand_info[nand_curr_device];
+ mtd = nand_info[nand_curr_device];
memset(&opts, 0, sizeof(opts));
opts.offset = dfu->data.nand.start + dfu->offset +
dfu->bad_skip;
opts.length = dfu->data.nand.start +
dfu->data.nand.size - opts.offset;
- ret = nand_erase_opts(nand, &opts);
+ ret = nand_erase_opts(mtd, &opts);
if (ret != 0)
printf("Failure erase: %d\n", ret);
}