aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdconcat.c
diff options
context:
space:
mode:
authorJoern Engel <joern@wh.fh-wedel.de>2006-05-22 17:18:05 -0400
committerJoern Engel <joern@wh.fh-wedel.de>2006-05-22 17:18:05 -0400
commit28318776a80bc3261f9af91ef79e6e38bb9f5bec (patch)
tree36ef9144accf19db9d51019aa479807e80aeb8fd /drivers/mtd/mtdconcat.c
parent8ca9ed5db3aea8d27989c239e8a2f79b839f1e99 (diff)
[MTD] Introduce writesize
At least two flashes exists that have the concept of a minimum write unit, similar to NAND pages, but no other NAND characteristics. Therefore, rename the minimum write unit to "writesize" for all flashes, including NAND. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
Diffstat (limited to 'drivers/mtd/mtdconcat.c')
-rw-r--r--drivers/mtd/mtdconcat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index 3c61a980c56..a5e8373349a 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -278,9 +278,9 @@ concat_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
278 return -EINVAL; 278 return -EINVAL;
279 279
280 /* Check alignment */ 280 /* Check alignment */
281 if (mtd->oobblock > 1) { 281 if (mtd->writesize > 1) {
282 loff_t __to = to; 282 loff_t __to = to;
283 if (do_div(__to, mtd->oobblock) || (total_len % mtd->oobblock)) 283 if (do_div(__to, mtd->writesize) || (total_len % mtd->writesize))
284 return -EINVAL; 284 return -EINVAL;
285 } 285 }
286 286
@@ -334,7 +334,7 @@ concat_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
334 *retlen += retsize; 334 *retlen += retsize;
335 total_len -= wsize; 335 total_len -= wsize;
336 if (concat->mtd.type == MTD_NANDFLASH && eccbuf) 336 if (concat->mtd.type == MTD_NANDFLASH && eccbuf)
337 eccbuf += mtd->oobavail * (wsize / mtd->oobblock); 337 eccbuf += mtd->oobavail * (wsize / mtd->writesize);
338 338
339 if (total_len == 0) 339 if (total_len == 0)
340 break; 340 break;
@@ -833,7 +833,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
833 concat->mtd.flags = subdev[0]->flags; 833 concat->mtd.flags = subdev[0]->flags;
834 concat->mtd.size = subdev[0]->size; 834 concat->mtd.size = subdev[0]->size;
835 concat->mtd.erasesize = subdev[0]->erasesize; 835 concat->mtd.erasesize = subdev[0]->erasesize;
836 concat->mtd.oobblock = subdev[0]->oobblock; 836 concat->mtd.writesize = subdev[0]->writesize;
837 concat->mtd.oobsize = subdev[0]->oobsize; 837 concat->mtd.oobsize = subdev[0]->oobsize;
838 concat->mtd.ecctype = subdev[0]->ecctype; 838 concat->mtd.ecctype = subdev[0]->ecctype;
839 concat->mtd.eccsize = subdev[0]->eccsize; 839 concat->mtd.eccsize = subdev[0]->eccsize;
@@ -881,7 +881,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
881 subdev[i]->flags & MTD_WRITEABLE; 881 subdev[i]->flags & MTD_WRITEABLE;
882 } 882 }
883 concat->mtd.size += subdev[i]->size; 883 concat->mtd.size += subdev[i]->size;
884 if (concat->mtd.oobblock != subdev[i]->oobblock || 884 if (concat->mtd.writesize != subdev[i]->writesize ||
885 concat->mtd.oobsize != subdev[i]->oobsize || 885 concat->mtd.oobsize != subdev[i]->oobsize ||
886 concat->mtd.ecctype != subdev[i]->ecctype || 886 concat->mtd.ecctype != subdev[i]->ecctype ||
887 concat->mtd.eccsize != subdev[i]->eccsize || 887 concat->mtd.eccsize != subdev[i]->eccsize ||