mtd: nand: bch: switch to mtd_ooblayout_ops

Replace the nand_ecclayout definition by the equivalent mtd_ooblayout_ops
definition.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
This commit is contained in:
Boris Brezillon
2016-02-03 19:53:40 +01:00
parent 41b207a70d
commit 7cf9c19a83
2 changed files with 26 additions and 30 deletions

View File

@@ -4294,6 +4294,21 @@ int nand_scan_tail(struct mtd_info *mtd)
ecc->strength = 4;
}
/*
* if no ecc placement scheme was provided pickup the default
* large page one.
*/
if (!mtd->ooblayout) {
/* handle large page devices only */
if (mtd->oobsize < 64) {
WARN(1, "OOB layout is required when using software BCH on small pages\n");
ret = -EINVAL;
goto err_free;
}
mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops);
}
/* See nand_bch_init() for details. */
ecc->bytes = 0;
ecc->priv = nand_bch_init(mtd);