Currently only one driver in the tree (denali.c) needs interleaved layout support. Make support for it optional to safe a few bytes of binary space when interleaved support is not needed. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/mtd/nand/raw/Kconfig | 4 ++++ drivers/mtd/nand/raw/nand_base.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig index e9d1b83706..b6c6e62731 100644 --- a/drivers/mtd/nand/raw/Kconfig +++ b/drivers/mtd/nand/raw/Kconfig @@ -35,6 +35,9 @@ config NAND_ALLOW_ERASE_BAD config NAND_NEED_EXEC_OP bool +config NAND_NEED_ECC_PLACEMENT_INTERLEAVED + bool + comment "Raw/parallel NAND flash controllers" config NAND_IMX @@ -156,6 +159,7 @@ config MTD_NAND_DENALI tristate "Support Denali NAND controller" depends on HAS_DMA select NAND_NEED_EXEC_OP + select NAND_NEED_ECC_PLACEMENT_INTERLEAVED help Enable support for the Denali NAND controller. This should be combined with either the PCI or platform drivers to provide device diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index cf4d510211..5ab5e9e03a 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -5671,6 +5671,8 @@ static int nand_set_ecc_on_host_ops(struct nand_chip *chip) fallthrough; case NAND_ECC_PLACEMENT_INTERLEAVED: + if (!IS_ENABLED(CONFIG_NAND_NEED_ECC_PLACEMENT_INTERLEAVED)) + break; if ((!ecc->calculate || !ecc->correct || !ecc->hwctl) && (!ecc->read_page || ecc->read_page == nand_read_page_hwecc || -- 2.39.2