diff options
-rw-r--r-- | drivers/mtd/nftlmount.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c index 51b9d6af307f..a5dfbfbebfca 100644 --- a/drivers/mtd/nftlmount.c +++ b/drivers/mtd/nftlmount.c | |||
@@ -89,9 +89,10 @@ static int find_boot_record(struct NFTLrecord *nftl) | |||
89 | } | 89 | } |
90 | 90 | ||
91 | /* To be safer with BIOS, also use erase mark as discriminant */ | 91 | /* To be safer with BIOS, also use erase mark as discriminant */ |
92 | if ((ret = nftl_read_oob(mtd, block * nftl->EraseSize + | 92 | ret = nftl_read_oob(mtd, block * nftl->EraseSize + |
93 | SECTORSIZE + 8, 8, &retlen, | 93 | SECTORSIZE + 8, 8, &retlen, |
94 | (char *)&h1) < 0)) { | 94 | (char *)&h1); |
95 | if (ret < 0) { | ||
95 | printk(KERN_WARNING "ANAND header found at 0x%x in mtd%d, but OOB data read failed (err %d)\n", | 96 | printk(KERN_WARNING "ANAND header found at 0x%x in mtd%d, but OOB data read failed (err %d)\n", |
96 | block * nftl->EraseSize, nftl->mbd.mtd->index, ret); | 97 | block * nftl->EraseSize, nftl->mbd.mtd->index, ret); |
97 | continue; | 98 | continue; |
@@ -109,8 +110,9 @@ static int find_boot_record(struct NFTLrecord *nftl) | |||
109 | } | 110 | } |
110 | 111 | ||
111 | /* Finally reread to check ECC */ | 112 | /* Finally reread to check ECC */ |
112 | if ((ret = mtd->read(mtd, block * nftl->EraseSize, SECTORSIZE, | 113 | ret = mtd->read(mtd, block * nftl->EraseSize, SECTORSIZE, |
113 | &retlen, buf) < 0)) { | 114 | &retlen, buf); |
115 | if (ret < 0) { | ||
114 | printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but ECC read failed (err %d)\n", | 116 | printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but ECC read failed (err %d)\n", |
115 | block * nftl->EraseSize, nftl->mbd.mtd->index, ret); | 117 | block * nftl->EraseSize, nftl->mbd.mtd->index, ret); |
116 | continue; | 118 | continue; |
@@ -228,9 +230,11 @@ device is already correct. | |||
228 | The new DiskOnChip driver already scanned the bad block table. Just query it. | 230 | The new DiskOnChip driver already scanned the bad block table. Just query it. |
229 | if ((i & (SECTORSIZE - 1)) == 0) { | 231 | if ((i & (SECTORSIZE - 1)) == 0) { |
230 | /* read one sector for every SECTORSIZE of blocks */ | 232 | /* read one sector for every SECTORSIZE of blocks */ |
231 | if ((ret = mtd->read(nftl->mbd.mtd, block * nftl->EraseSize + | 233 | ret = mtd->read(nftl->mbd.mtd, |
232 | i + SECTORSIZE, SECTORSIZE, &retlen, | 234 | block * nftl->EraseSize + i + |
233 | buf)) < 0) { | 235 | SECTORSIZE, SECTORSIZE, |
236 | &retlen, buf); | ||
237 | if (ret < 0) { | ||
234 | printk(KERN_NOTICE "Read of bad sector table failed (err %d)\n", | 238 | printk(KERN_NOTICE "Read of bad sector table failed (err %d)\n", |
235 | ret); | 239 | ret); |
236 | kfree(nftl->ReplUnitTable); | 240 | kfree(nftl->ReplUnitTable); |