mtd: nand: Create a helper to extract the ECC configuration
authorMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 27 Aug 2020 08:51:59 +0000 (10:51 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 28 Sep 2020 13:59:48 +0000 (15:59 +0200)
commitd193792a26c216cb7db3cf12300c9414990fa603
treea4572a219683dcb4580df627f5919ec134c1065e
parentbace41f80f65dc4ba13c892bac783e7e81847379
mtd: nand: Create a helper to extract the ECC configuration

Despite its current name, the eccreq field actually encodes both the
NAND requirements and the final ECC configuration. That works fine when
using on-die ECC since those 2 concepts match perfectly, but it starts
being a problem as soon as we use on-host ECC engines, where we're not
guaranteed to have a perfect match.

Let's hide the ECC configuration access behind a helper so we can later
split those 2 concepts.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200827085208.16276-12-miquel.raynal@bootlin.com
include/linux/mtd/nand.h