mtd: nand: Add max_bad_eraseblocks_per_lun info to memorg
authorBoris Brezillon <bbrezillon@kernel.org>
Sun, 4 Nov 2018 13:43:37 +0000 (14:43 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 8 Apr 2019 08:21:08 +0000 (10:21 +0200)
commit377e517b5fa53590418a7b4c2206082d92434fa3
tree04b56af9accf4b06573fa8e3f6267cf3283768e9
parentd090c25028e9df186bb0d31379f7d5605c57fa79
mtd: nand: Add max_bad_eraseblocks_per_lun info to memorg

NAND datasheets usually give the maximum number of bad blocks per LUN
and this number can be used to help upper layers decide how much blocks
they should reserve for bad block handling.

Add a max_bad_eraseblocks_per_lun to the nand_memory_organization
struct and update the NAND_MEMORG() macro (and its users) accordingly.

We also provide a default mtd->_max_bad_blocks() implementation.

Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
drivers/mtd/nand/core.c
drivers/mtd/nand/spi/gigadevice.c
drivers/mtd/nand/spi/macronix.c
drivers/mtd/nand/spi/micron.c
drivers/mtd/nand/spi/toshiba.c
drivers/mtd/nand/spi/winbond.c
include/linux/mtd/nand.h