UPSTREAM: mtd: spinand: Fill a default ECC provider/algorithm

The SPI-NAND layer default is on-die ECC because until now it was the
only one supported. New SPI-NAND chip flavors might use something else
as ECC engine provider but this will always be the default if the user
does not choose explicitly something else.

Change-Id: Ia437dda2d2a43007bf04e2e6a072610c283c97d6
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200930154109.3922-6-miquel.raynal@bootlin.com
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit c8efe01028)
This commit is contained in:
Miquel Raynal
2020-09-30 17:41:09 +02:00
committed by Tao Huang
parent a516594d0c
commit 91915f631e

View File

@@ -310,7 +310,7 @@ static struct nand_ecc_engine_ops spinand_ondie_ecc_engine_ops = {
.finish_io_req = spinand_ondie_ecc_finish_io_req,
};
static __maybe_unused struct nand_ecc_engine spinand_ondie_ecc_engine = {
static struct nand_ecc_engine spinand_ondie_ecc_engine = {
.ops = &spinand_ondie_ecc_engine_ops,
};
@@ -1137,6 +1137,10 @@ static int spinand_init(struct spinand_device *spinand)
if (ret)
goto err_manuf_cleanup;
/* SPI-NAND default ECC engine is on-die */
nand->ecc.defaults.engine_type = NAND_ECC_ENGINE_TYPE_ON_DIE;
nand->ecc.ondie_engine = &spinand_ondie_ecc_engine;
/*
* Right now, we don't support ECC, so let the whole oob
* area is available for user.