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/rfd_ftl.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/rfd_ftl.c')
-rw-r--r-- | drivers/mtd/rfd_ftl.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index 39de8727a524..d9fe2d0533d9 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c | |||
@@ -200,9 +200,9 @@ static int scan_header(struct partition *part) | |||
200 | part->sector_map[i] = -1; | 200 | part->sector_map[i] = -1; |
201 | 201 | ||
202 | for (i=0, blocks_found=0; i<part->total_blocks; i++) { | 202 | for (i=0, blocks_found=0; i<part->total_blocks; i++) { |
203 | rc = part->mbd.mtd->read(part->mbd.mtd, | 203 | rc = mtd_read(part->mbd.mtd, i * part->block_size, |
204 | i * part->block_size, part->header_size, | 204 | part->header_size, &retlen, |
205 | &retlen, (u_char*)part->header_cache); | 205 | (u_char *)part->header_cache); |
206 | 206 | ||
207 | if (!rc && retlen != part->header_size) | 207 | if (!rc && retlen != part->header_size) |
208 | rc = -EIO; | 208 | rc = -EIO; |
@@ -250,8 +250,8 @@ static int rfd_ftl_readsect(struct mtd_blktrans_dev *dev, u_long sector, char *b | |||
250 | 250 | ||
251 | addr = part->sector_map[sector]; | 251 | addr = part->sector_map[sector]; |
252 | if (addr != -1) { | 252 | if (addr != -1) { |
253 | rc = part->mbd.mtd->read(part->mbd.mtd, addr, SECTOR_SIZE, | 253 | rc = mtd_read(part->mbd.mtd, addr, SECTOR_SIZE, &retlen, |
254 | &retlen, (u_char*)buf); | 254 | (u_char *)buf); |
255 | if (!rc && retlen != SECTOR_SIZE) | 255 | if (!rc && retlen != SECTOR_SIZE) |
256 | rc = -EIO; | 256 | rc = -EIO; |
257 | 257 | ||
@@ -372,9 +372,8 @@ static int move_block_contents(struct partition *part, int block_no, u_long *old | |||
372 | if (!map) | 372 | if (!map) |
373 | goto err2; | 373 | goto err2; |
374 | 374 | ||
375 | rc = part->mbd.mtd->read(part->mbd.mtd, | 375 | rc = mtd_read(part->mbd.mtd, part->blocks[block_no].offset, |
376 | part->blocks[block_no].offset, part->header_size, | 376 | part->header_size, &retlen, (u_char *)map); |
377 | &retlen, (u_char*)map); | ||
378 | 377 | ||
379 | if (!rc && retlen != part->header_size) | 378 | if (!rc && retlen != part->header_size) |
380 | rc = -EIO; | 379 | rc = -EIO; |
@@ -413,8 +412,8 @@ static int move_block_contents(struct partition *part, int block_no, u_long *old | |||
413 | } | 412 | } |
414 | continue; | 413 | continue; |
415 | } | 414 | } |
416 | rc = part->mbd.mtd->read(part->mbd.mtd, addr, | 415 | rc = mtd_read(part->mbd.mtd, addr, SECTOR_SIZE, &retlen, |
417 | SECTOR_SIZE, &retlen, sector_data); | 416 | sector_data); |
418 | 417 | ||
419 | if (!rc && retlen != SECTOR_SIZE) | 418 | if (!rc && retlen != SECTOR_SIZE) |
420 | rc = -EIO; | 419 | rc = -EIO; |
@@ -563,8 +562,9 @@ static int find_writable_block(struct partition *part, u_long *old_sector) | |||
563 | } | 562 | } |
564 | } | 563 | } |
565 | 564 | ||
566 | rc = part->mbd.mtd->read(part->mbd.mtd, part->blocks[block].offset, | 565 | rc = mtd_read(part->mbd.mtd, part->blocks[block].offset, |
567 | part->header_size, &retlen, (u_char*)part->header_cache); | 566 | part->header_size, &retlen, |
567 | (u_char *)part->header_cache); | ||
568 | 568 | ||
569 | if (!rc && retlen != part->header_size) | 569 | if (!rc && retlen != part->header_size) |
570 | rc = -EIO; | 570 | rc = -EIO; |