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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 43fdc9433882..f89a03795e76 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -350,21 +350,21 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
350 int len, int check_oob) 350 int len, int check_oob)
351{ 351{
352 u8 buf[SECTORSIZE + inftl->mbd.mtd->oobsize]; 352 u8 buf[SECTORSIZE + inftl->mbd.mtd->oobsize];
353 struct mtd_info *mtd = inftl->mbd.mtd;
353 size_t retlen; 354 size_t retlen;
354 int i; 355 int i;
355 356
356 DEBUG(MTD_DEBUG_LEVEL3, "INFTL: check_free_sectors(inftl=%p,"
357 "address=0x%x,len=%d,check_oob=%d)\n", inftl,
358 address, len, check_oob);
359
360 for (i = 0; i < len; i += SECTORSIZE) { 357 for (i = 0; i < len; i += SECTORSIZE) {
361 if (MTD_READECC(inftl->mbd.mtd, address, SECTORSIZE, &retlen, buf, &buf[SECTORSIZE], &inftl->oobinfo) < 0) 358 if (mtd->read(mtd, address, SECTORSIZE, &retlen, buf))
362 return -1; 359 return -1;
363 if (memcmpb(buf, 0xff, SECTORSIZE) != 0) 360 if (memcmpb(buf, 0xff, SECTORSIZE) != 0)
364 return -1; 361 return -1;
365 362
366 if (check_oob) { 363 if (check_oob) {
367 if (memcmpb(buf + SECTORSIZE, 0xff, inftl->mbd.mtd->oobsize) != 0) 364 if(mtd->read_oob(mtd, address, mtd->oobsize,
365 &retlen, &buf[SECTORSIZE]) < 0)
366 return -1;
367 if (memcmpb(buf + SECTORSIZE, 0xff, mtd->oobsize) != 0)
368 return -1; 368 return -1;
369 } 369 }
370 address += SECTORSIZE; 370 address += SECTORSIZE;