aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/inftlmount.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/inftlmount.c')
-rw-r--r--drivers/mtd/inftlmount.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 2ff601f816ce..4adc0374fb6b 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -73,8 +73,8 @@ static int find_boot_record(struct INFTLrecord *inftl)
73 * Check for BNAND header first. Then whinge if it's found 73 * Check for BNAND header first. Then whinge if it's found
74 * but later checks fail. 74 * but later checks fail.
75 */ 75 */
76 ret = mtd->read(mtd, block * inftl->EraseSize, 76 ret = mtd_read(mtd, block * inftl->EraseSize, SECTORSIZE,
77 SECTORSIZE, &retlen, buf); 77 &retlen, buf);
78 /* We ignore ret in case the ECC of the MediaHeader is invalid 78 /* We ignore ret in case the ECC of the MediaHeader is invalid
79 (which is apparently acceptable) */ 79 (which is apparently acceptable) */
80 if (retlen != SECTORSIZE) { 80 if (retlen != SECTORSIZE) {
@@ -118,8 +118,8 @@ static int find_boot_record(struct INFTLrecord *inftl)
118 memcpy(mh, buf, sizeof(struct INFTLMediaHeader)); 118 memcpy(mh, buf, sizeof(struct INFTLMediaHeader));
119 119
120 /* Read the spare media header at offset 4096 */ 120 /* Read the spare media header at offset 4096 */
121 mtd->read(mtd, block * inftl->EraseSize + 4096, 121 mtd_read(mtd, block * inftl->EraseSize + 4096, SECTORSIZE,
122 SECTORSIZE, &retlen, buf); 122 &retlen, buf);
123 if (retlen != SECTORSIZE) { 123 if (retlen != SECTORSIZE) {
124 printk(KERN_WARNING "INFTL: Unable to read spare " 124 printk(KERN_WARNING "INFTL: Unable to read spare "
125 "Media Header\n"); 125 "Media Header\n");
@@ -220,7 +220,7 @@ static int find_boot_record(struct INFTLrecord *inftl)
220 */ 220 */
221 instr->addr = ip->Reserved0 * inftl->EraseSize; 221 instr->addr = ip->Reserved0 * inftl->EraseSize;
222 instr->len = inftl->EraseSize; 222 instr->len = inftl->EraseSize;
223 mtd->erase(mtd, instr); 223 mtd_erase(mtd, instr);
224 } 224 }
225 if ((ip->lastUnit - ip->firstUnit + 1) < ip->virtualUnits) { 225 if ((ip->lastUnit - ip->firstUnit + 1) < ip->virtualUnits) {
226 printk(KERN_WARNING "INFTL: Media Header " 226 printk(KERN_WARNING "INFTL: Media Header "
@@ -306,7 +306,8 @@ static int find_boot_record(struct INFTLrecord *inftl)
306 /* If any of the physical eraseblocks are bad, don't 306 /* If any of the physical eraseblocks are bad, don't
307 use the unit. */ 307 use the unit. */
308 for (physblock = 0; physblock < inftl->EraseSize; physblock += inftl->mbd.mtd->erasesize) { 308 for (physblock = 0; physblock < inftl->EraseSize; physblock += inftl->mbd.mtd->erasesize) {
309 if (inftl->mbd.mtd->block_isbad(inftl->mbd.mtd, i * inftl->EraseSize + physblock)) 309 if (mtd_block_isbad(inftl->mbd.mtd,
310 i * inftl->EraseSize + physblock))
310 inftl->PUtable[i] = BLOCK_RESERVED; 311 inftl->PUtable[i] = BLOCK_RESERVED;
311 } 312 }
312 } 313 }
@@ -342,7 +343,7 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
342 int i; 343 int i;
343 344
344 for (i = 0; i < len; i += SECTORSIZE) { 345 for (i = 0; i < len; i += SECTORSIZE) {
345 if (mtd->read(mtd, address, SECTORSIZE, &retlen, buf)) 346 if (mtd_read(mtd, address, SECTORSIZE, &retlen, buf))
346 return -1; 347 return -1;
347 if (memcmpb(buf, 0xff, SECTORSIZE) != 0) 348 if (memcmpb(buf, 0xff, SECTORSIZE) != 0)
348 return -1; 349 return -1;
@@ -393,7 +394,7 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
393 mark only the failed block in the bbt. */ 394 mark only the failed block in the bbt. */
394 for (physblock = 0; physblock < inftl->EraseSize; 395 for (physblock = 0; physblock < inftl->EraseSize;
395 physblock += instr->len, instr->addr += instr->len) { 396 physblock += instr->len, instr->addr += instr->len) {
396 mtd->erase(inftl->mbd.mtd, instr); 397 mtd_erase(inftl->mbd.mtd, instr);
397 398
398 if (instr->state == MTD_ERASE_FAILED) { 399 if (instr->state == MTD_ERASE_FAILED) {
399 printk(KERN_WARNING "INFTL: error while formatting block %d\n", 400 printk(KERN_WARNING "INFTL: error while formatting block %d\n",
@@ -423,7 +424,7 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
423fail: 424fail:
424 /* could not format, update the bad block table (caller is responsible 425 /* could not format, update the bad block table (caller is responsible
425 for setting the PUtable to BLOCK_RESERVED on failure) */ 426 for setting the PUtable to BLOCK_RESERVED on failure) */
426 inftl->mbd.mtd->block_markbad(inftl->mbd.mtd, instr->addr); 427 mtd_block_markbad(inftl->mbd.mtd, instr->addr);
427 return -1; 428 return -1;
428} 429}
429 430