[RFC PATCH 07/27] mtd: nand: ecc: Move BCH code into the ecc/ directory
From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2019-02-21 10:04:41
Subsystem:
memory technology devices (mtd), nand flash subsystem, the rest · Maintainers:
Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Linus Torvalds
Move generic ECC code in the ecc/ sub-directory for later re-use by
the SPI NAND layer.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/ecc/Kconfig | 10 ++++++++++
drivers/mtd/nand/ecc/Makefile | 1 +
.../mtd/nand/{raw/nand_bch.c => ecc/sw-bch-engine.c} | 2 +-
drivers/mtd/nand/raw/Kconfig | 10 ----------
drivers/mtd/nand/raw/Makefile | 1 -
drivers/mtd/nand/raw/nand_base.c | 2 +-
drivers/mtd/nand/raw/nandsim.c | 2 +-
drivers/mtd/nand/raw/omap2.c | 2 +-
include/linux/mtd/{nand_bch.h => nand-sw-bch-engine.h} | 6 +++---
9 files changed, 18 insertions(+), 18 deletions(-)
rename drivers/mtd/nand/{raw/nand_bch.c => ecc/sw-bch-engine.c} (99%)
rename include/linux/mtd/{nand_bch.h => nand-sw-bch-engine.h} (93%)
diff --git a/drivers/mtd/nand/ecc/Kconfig b/drivers/mtd/nand/ecc/Kconfig
index 66c396dcbfbd..a05f1d474446 100644
--- a/drivers/mtd/nand/ecc/Kconfig
+++ b/drivers/mtd/nand/ecc/Kconfig@@ -1,3 +1,13 @@ menu "ECC engine support" +config MTD_NAND_ECC_SW_BCH + bool "Software BCH ECC engine" + select BCH + default n + help + This enables support for software BCH error correction. Binary BCH + codes are more powerful and cpu intensive than traditional Hamming + ECC codes. They are used with NAND devices requiring more than 1 bit + of error correction. + endmenu
diff --git a/drivers/mtd/nand/ecc/Makefile b/drivers/mtd/nand/ecc/Makefile
index 6a42577ba424..fdbfc2bc38d7 100644
--- a/drivers/mtd/nand/ecc/Makefile
+++ b/drivers/mtd/nand/ecc/Makefile@@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_MTD_NAND_CORE) += engine.o +obj-$(CONFIG_MTD_NAND_ECC_SW_BCH) += sw-bch-engine.o
diff --git a/drivers/mtd/nand/raw/nand_bch.c b/drivers/mtd/nand/ecc/sw-bch-engine.c
similarity index 99%
rename from drivers/mtd/nand/raw/nand_bch.c
rename to drivers/mtd/nand/ecc/sw-bch-engine.c
index 574c0ca16160..37dc0f0061d3 100644
--- a/drivers/mtd/nand/raw/nand_bch.c
+++ b/drivers/mtd/nand/ecc/sw-bch-engine.c@@ -26,7 +26,7 @@ #include <linux/bitops.h> #include <linux/mtd/mtd.h> #include <linux/mtd/rawnand.h> -#include <linux/mtd/nand_bch.h> +#include <linux/mtd/nand-sw-bch-engine.h> #include <linux/bch.h> /**
diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index ebb8a3da9fa5..478bc3f3c042 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig@@ -19,16 +19,6 @@ menuconfig MTD_RAW_NAND if MTD_RAW_NAND -config MTD_NAND_ECC_SW_BCH - bool "Support software BCH ECC" - select BCH - default n - help - This enables support for software BCH error correction. Binary BCH - codes are more powerful and cpu intensive than traditional Hamming - ECC codes. They are used with NAND devices requiring more than 1 bit - of error correction. - comment "Raw/parallel NAND flash controllers" config MTD_NAND_DENALI
diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index ffe95b157131..18ae42077b05 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile@@ -2,7 +2,6 @@ obj-$(CONFIG_MTD_RAW_NAND) += nand.o obj-$(CONFIG_MTD_NAND_ECC_SW_HAMMING) += nand_ecc.o -obj-$(CONFIG_MTD_NAND_ECC_SW_BCH) += nand_bch.o obj-$(CONFIG_MTD_SM_COMMON) += sm_common.o obj-$(CONFIG_MTD_NAND_CAFE) += cafe_nand.o
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 39cd2b163dc9..8a9cbe3aa7c1 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c@@ -40,7 +40,7 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/nand.h> #include <linux/mtd/nand_ecc.h> -#include <linux/mtd/nand_bch.h> +#include <linux/mtd/nand-sw-bch-engine.h> #include <linux/interrupt.h> #include <linux/bitops.h> #include <linux/io.h>
diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
index 670abe8d59ca..797a6e4999cc 100644
--- a/drivers/mtd/nand/raw/nandsim.c
+++ b/drivers/mtd/nand/raw/nandsim.c@@ -36,7 +36,7 @@ #include <linux/string.h> #include <linux/mtd/mtd.h> #include <linux/mtd/rawnand.h> -#include <linux/mtd/nand_bch.h> +#include <linux/mtd/nand-sw-bch-engine.h> #include <linux/mtd/partitions.h> #include <linux/delay.h> #include <linux/list.h>
diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c
index eaf14813a3ab..38550148a53b 100644
--- a/drivers/mtd/nand/raw/omap2.c
+++ b/drivers/mtd/nand/raw/omap2.c@@ -26,7 +26,7 @@ #include <linux/of.h> #include <linux/of_device.h> -#include <linux/mtd/nand_bch.h> +#include <linux/mtd/nand-sw-bch-engine.h> #include <linux/platform_data/elm.h> #include <linux/omap-gpmc.h>
diff --git a/include/linux/mtd/nand_bch.h b/include/linux/mtd/nand-sw-bch-engine.h
similarity index 93%
rename from include/linux/mtd/nand_bch.h
rename to include/linux/mtd/nand-sw-bch-engine.h
index 06ce2b655c13..a682a15fa165 100644
--- a/include/linux/mtd/nand_bch.h
+++ b/include/linux/mtd/nand-sw-bch-engine.h@@ -8,8 +8,8 @@ * This file is the header for the NAND BCH ECC implementation. */ -#ifndef __MTD_NAND_BCH_H__ -#define __MTD_NAND_BCH_H__ +#ifndef __MTD_NAND_ECC_SW_BCH_H__ +#define __MTD_NAND_ECC_SW_BCH_H__ struct mtd_info; struct nand_chip;
@@ -66,4 +66,4 @@ static inline void nand_bch_free(struct nand_bch_control *nbc) {} #endif /* CONFIG_MTD_NAND_ECC_SW_BCH */ -#endif /* __MTD_NAND_BCH_H__ */ +#endif /* __MTD_NAND_ECC_SW_BCH_H__ */
--
2.19.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel