aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/rfd_ftl.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-23 10:35:41 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:25:20 -0500
commiteda95cbf75193808f62948fb0142ba0901d8bee2 (patch)
tree047bcfa05bc118b1d34327b3e62fa1d10d4bcb43 /drivers/mtd/rfd_ftl.c
parent329ad399a9b3adf52c90637b21ca029fcf7f8795 (diff)
mtd: introduce mtd_write 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/rfd_ftl.c')
-rw-r--r--drivers/mtd/rfd_ftl.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c
index d9fe2d0533d9..c594bb7abfa3 100644
--- a/drivers/mtd/rfd_ftl.c
+++ b/drivers/mtd/rfd_ftl.c
@@ -304,9 +304,8 @@ static void erase_callback(struct erase_info *erase)
304 part->blocks[i].used_sectors = 0; 304 part->blocks[i].used_sectors = 0;
305 part->blocks[i].erases++; 305 part->blocks[i].erases++;
306 306
307 rc = part->mbd.mtd->write(part->mbd.mtd, 307 rc = mtd_write(part->mbd.mtd, part->blocks[i].offset, sizeof(magic),
308 part->blocks[i].offset, sizeof(magic), &retlen, 308 &retlen, (u_char *)&magic);
309 (u_char*)&magic);
310 309
311 if (!rc && retlen != sizeof(magic)) 310 if (!rc && retlen != sizeof(magic))
312 rc = -EIO; 311 rc = -EIO;
@@ -595,8 +594,8 @@ static int mark_sector_deleted(struct partition *part, u_long old_addr)
595 594
596 addr = part->blocks[block].offset + 595 addr = part->blocks[block].offset +
597 (HEADER_MAP_OFFSET + offset) * sizeof(u16); 596 (HEADER_MAP_OFFSET + offset) * sizeof(u16);
598 rc = part->mbd.mtd->write(part->mbd.mtd, addr, 597 rc = mtd_write(part->mbd.mtd, addr, sizeof(del), &retlen,
599 sizeof(del), &retlen, (u_char*)&del); 598 (u_char *)&del);
600 599
601 if (!rc && retlen != sizeof(del)) 600 if (!rc && retlen != sizeof(del))
602 rc = -EIO; 601 rc = -EIO;
@@ -668,8 +667,8 @@ static int do_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *buf,
668 667
669 addr = (i + part->header_sectors_per_block) * SECTOR_SIZE + 668 addr = (i + part->header_sectors_per_block) * SECTOR_SIZE +
670 block->offset; 669 block->offset;
671 rc = part->mbd.mtd->write(part->mbd.mtd, 670 rc = mtd_write(part->mbd.mtd, addr, SECTOR_SIZE, &retlen,
672 addr, SECTOR_SIZE, &retlen, (u_char*)buf); 671 (u_char *)buf);
673 672
674 if (!rc && retlen != SECTOR_SIZE) 673 if (!rc && retlen != SECTOR_SIZE)
675 rc = -EIO; 674 rc = -EIO;
@@ -688,8 +687,8 @@ static int do_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *buf,
688 part->header_cache[i + HEADER_MAP_OFFSET] = entry; 687 part->header_cache[i + HEADER_MAP_OFFSET] = entry;
689 688
690 addr = block->offset + (HEADER_MAP_OFFSET + i) * sizeof(u16); 689 addr = block->offset + (HEADER_MAP_OFFSET + i) * sizeof(u16);
691 rc = part->mbd.mtd->write(part->mbd.mtd, addr, 690 rc = mtd_write(part->mbd.mtd, addr, sizeof(entry), &retlen,
692 sizeof(entry), &retlen, (u_char*)&entry); 691 (u_char *)&entry);
693 692
694 if (!rc && retlen != sizeof(entry)) 693 if (!rc && retlen != sizeof(entry))
695 rc = -EIO; 694 rc = -EIO;