mtd: nand-bb: Fix test for bad block when reading
in nand_bb_read() 'offset' contains the virtual position on the device, but we have to test for a bad block on the raw physical position, so use bb->offset instead of offset Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
eebfbe9116
commit
ce073eb9e4
|
@ -62,7 +62,7 @@ static ssize_t nand_bb_read(struct cdev *cdev, void *buf, size_t count,
|
|||
if (max <= 0)
|
||||
break;
|
||||
|
||||
if (mtd_block_isbad(bb->mtd, offset)) {
|
||||
if (mtd_block_isbad(bb->mtd, bb->offset)) {
|
||||
printf("skipping bad block at 0x%08llx\n", bb->offset);
|
||||
bb->offset += bb->mtd->erasesize;
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue