diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 10:30:16 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:19 -0500 |
commit | 329ad399a9b3adf52c90637b21ca029fcf7f8795 (patch) | |
tree | 7aa7bb2609c25de7859c3a666f3ea90934609592 /drivers/mtd/nftlcore.c | |
parent | 04c601bfa4cb29c968dcb66e44c799c9c01d8675 (diff) |
mtd: introduce mtd_read interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nftlcore.c')
-rw-r--r-- | drivers/mtd/nftlcore.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c index cda77b562ad4..1a9d9c1d3a74 100644 --- a/drivers/mtd/nftlcore.c +++ b/drivers/mtd/nftlcore.c | |||
@@ -423,12 +423,17 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p | |||
423 | if (BlockMap[block] == BLOCK_NIL) | 423 | if (BlockMap[block] == BLOCK_NIL) |
424 | continue; | 424 | continue; |
425 | 425 | ||
426 | ret = mtd->read(mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512), | 426 | ret = mtd_read(mtd, |
427 | 512, &retlen, movebuf); | 427 | (nftl->EraseSize * BlockMap[block]) + (block * 512), |
428 | 512, | ||
429 | &retlen, | ||
430 | movebuf); | ||
428 | if (ret < 0 && !mtd_is_bitflip(ret)) { | 431 | if (ret < 0 && !mtd_is_bitflip(ret)) { |
429 | ret = mtd->read(mtd, (nftl->EraseSize * BlockMap[block]) | 432 | ret = mtd_read(mtd, |
430 | + (block * 512), 512, &retlen, | 433 | (nftl->EraseSize * BlockMap[block]) + (block * 512), |
431 | movebuf); | 434 | 512, |
435 | &retlen, | ||
436 | movebuf); | ||
432 | if (ret != -EIO) | 437 | if (ret != -EIO) |
433 | printk("Error went away on retry.\n"); | 438 | printk("Error went away on retry.\n"); |
434 | } | 439 | } |
@@ -771,7 +776,7 @@ static int nftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block, | |||
771 | } else { | 776 | } else { |
772 | loff_t ptr = (lastgoodEUN * nftl->EraseSize) + blockofs; | 777 | loff_t ptr = (lastgoodEUN * nftl->EraseSize) + blockofs; |
773 | size_t retlen; | 778 | size_t retlen; |
774 | int res = mtd->read(mtd, ptr, 512, &retlen, buffer); | 779 | int res = mtd_read(mtd, ptr, 512, &retlen, buffer); |
775 | 780 | ||
776 | if (res < 0 && !mtd_is_bitflip(res)) | 781 | if (res < 0 && !mtd_is_bitflip(res)) |
777 | return -EIO; | 782 | return -EIO; |