mtd: nand: hide in-memory BBT implementation details
authorBrian Norris <computersforpeace@gmail.com>
Wed, 31 Jul 2013 00:52:59 +0000 (17:52 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 30 Aug 2013 15:48:17 +0000 (16:48 +0100)
commitb32843b772db6024336e36c39359d8edc3b416ab
tree9e4cd381d3abfa5075dceb1ff544908645431a4b
parent5a0edb251ae91c6f9b1f28dc165becd955666118
mtd: nand: hide in-memory BBT implementation details

nand_base.c shouldn't have to know the implementation details of
nand_bbt's in-memory BBT. Specifically, nand_base shouldn't perform the
bit masking and shifting to isolate a BBT entry.

Instead, just move some of the BBT code into a new nand_markbad_bbt()
interface. This interface allows external users (i.e., nand_base) to
mark a single block as bad in the BBT. Then nand_bbt will take care of
modifying the in-memory BBT and updating the flash-based BBT (if
applicable).

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_bbt.c
include/linux/mtd/nand.h