aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 62b861304e03..0a54d003ef34 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1093,9 +1093,10 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
1093 1093
1094 ret = nand_do_read_ops(mtd, from, &chip->ops); 1094 ret = nand_do_read_ops(mtd, from, &chip->ops);
1095 1095
1096 *retlen = chip->ops.retlen;
1097
1096 nand_release_device(mtd); 1098 nand_release_device(mtd);
1097 1099
1098 *retlen = chip->ops.retlen;
1099 return ret; 1100 return ret;
1100} 1101}
1101 1102
@@ -1203,7 +1204,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd,
1203 pos = steps * (eccsize + chunk); 1204 pos = steps * (eccsize + chunk);
1204 steps = 0; 1205 steps = 0;
1205 } else 1206 } else
1206 pos = eccsize + chunk; 1207 pos = eccsize;
1207 1208
1208 chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page); 1209 chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page);
1209 for (i = 0; i < steps; i++) { 1210 for (i = 0; i < steps; i++) {
@@ -1566,7 +1567,7 @@ static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob,
1566 bytes = min_t(size_t, len, free->length); 1567 bytes = min_t(size_t, len, free->length);
1567 boffs = free->offset; 1568 boffs = free->offset;
1568 } 1569 }
1569 memcpy(chip->oob_poi + woffs, oob, bytes); 1570 memcpy(chip->oob_poi + boffs, oob, bytes);
1570 oob += bytes; 1571 oob += bytes;
1571 } 1572 }
1572 return oob; 1573 return oob;
@@ -1691,9 +1692,10 @@ static int nand_write(struct mtd_info *mtd, loff_t to, size_t len,
1691 1692
1692 ret = nand_do_write_ops(mtd, to, &chip->ops); 1693 ret = nand_do_write_ops(mtd, to, &chip->ops);
1693 1694
1695 *retlen = chip->ops.retlen;
1696
1694 nand_release_device(mtd); 1697 nand_release_device(mtd);
1695 1698
1696 *retlen = chip->ops.retlen;
1697 return ret; 1699 return ret;
1698} 1700}
1699 1701