There is no reason to prevent the software BCH ECC engine implementation to be compiled as a module, so change the 'bool' into a 'tristate'. Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> --- drivers/mtd/nand/ecc/Kconfig | 6 +++++- include/linux/mtd/nand-ecc-sw-bch.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/ecc/Kconfig b/drivers/mtd/nand/ecc/Kconfig index 7be48a7efda0..a9ab9bab252c 100644 --- a/drivers/mtd/nand/ecc/Kconfig +++ b/drivers/mtd/nand/ecc/Kconfig @@ -15,7 +15,7 @@ config MTD_NAND_ECC_SW_HAMMING_SMC The original Linux implementation had byte 0 and 1 swapped. config MTD_NAND_ECC_SW_BCH - bool "Software BCH ECC engine" + tristate "Software BCH ECC engine" select BCH select MTD_NAND_ECC default n @@ -25,4 +25,8 @@ config MTD_NAND_ECC_SW_BCH ECC codes. They are used with NAND devices requiring more than 1 bit of error correction. + If you are booting from NAND and need the BCH engine in order to mount + your filesystem, then do not select =m for this option unless you have + an initramfs. + endmenu diff --git a/include/linux/mtd/nand-ecc-sw-bch.h b/include/linux/mtd/nand-ecc-sw-bch.h index 509723870fc8..e72f781829c8 100644 --- a/include/linux/mtd/nand-ecc-sw-bch.h +++ b/include/linux/mtd/nand-ecc-sw-bch.h @@ -33,7 +33,7 @@ struct nand_ecc_sw_bch_conf { unsigned char *eccmask; }; -#if defined(CONFIG_MTD_NAND_ECC_SW_BCH) +#if IS_REACHABLE(CONFIG_MTD_NAND_ECC_SW_BCH) int nand_ecc_sw_bch_calculate(struct nand_device *nand, const unsigned char *buf, unsigned char *code); -- 2.19.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/