mtd: nand_bbt: scan for next free bbt block if writing bbt fails
authorKyle Roeschley <kyle.roeschley@ni.com>
Mon, 15 Aug 2016 23:22:02 +0000 (18:22 -0500)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Fri, 23 Sep 2016 07:35:16 +0000 (09:35 +0200)
commit10ffd570f11701972aff2a6f91f3d253d6f0e7ee
tree2dfb9bdfd70f15c4167bbe359ead802b07e47252
parentc3baf278d3bf8d628df0b28aa4921c5457d40211
mtd: nand_bbt: scan for next free bbt block if writing bbt fails

If erasing or writing the BBT fails, we should mark the current BBT
block as bad and use the BBT descriptor to scan for the next available
unused block in the BBT. We should only return a failure if there isn't
any space left.

Signed-off-by: Kyle Roeschley <kyle.roeschley@ni.com>
Suggested-by: Jeff Westfahl <jeff.westfahl@ni.com>
Tested-by: Kyle Roeschley <kyle.roeschley@ni.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/nand_bbt.c