diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-24 10:01:43 +0100 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-24 10:01:43 +0100 |
commit | 0305c8659ff9cebabf469d5cd0ab8dc384857e10 (patch) | |
tree | 1784b2bb078a58e50ca75dfccd1e9fc5f8b211b8 /drivers/mtd/nftlmount.c | |
parent | 99988f7bbd16b861590dda4631c4db6cb17b5091 (diff) | |
parent | d470a97c70a43ffafd6e728c913254b6d6fd1219 (diff) |
Merge branch 'master' of git://git.infradead.org/~gleixner/mtd-nand-2.6.git
Diffstat (limited to 'drivers/mtd/nftlmount.c')
-rw-r--r-- | drivers/mtd/nftlmount.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c index 3b104ebb219..90e5e7e97fd 100644 --- a/drivers/mtd/nftlmount.c +++ b/drivers/mtd/nftlmount.c @@ -268,18 +268,22 @@ static int memcmpb(void *a, int c, int n) static int check_free_sectors(struct NFTLrecord *nftl, unsigned int address, int len, int check_oob) { - int i; - size_t retlen; u8 buf[SECTORSIZE + nftl->mbd.mtd->oobsize]; + struct mtd_info *mtd = nftl->mbd.mtd; + size_t retlen; + int i; for (i = 0; i < len; i += SECTORSIZE) { - if (MTD_READECC(nftl->mbd.mtd, address, SECTORSIZE, &retlen, buf, &buf[SECTORSIZE], &nftl->oobinfo) < 0) + if (mtd->read(mtd, address, SECTORSIZE, &retlen, buf)) return -1; if (memcmpb(buf, 0xff, SECTORSIZE) != 0) return -1; if (check_oob) { - if (memcmpb(buf + SECTORSIZE, 0xff, nftl->mbd.mtd->oobsize) != 0) + if(mtd->read_oob(mtd, address, mtd->oobsize, + &retlen, &buf[SECTORSIZE]) < 0) + return -1; + if (memcmpb(buf + SECTORSIZE, 0xff, mtd->oobsize) != 0) return -1; } address += SECTORSIZE; |