mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
mtd: rawnand: Add an invalid ECC mode to discriminate with valid ones
NAND ECC modes (or providers) have their own enumeration but, unlike their algorithms counterpart, there is no invalid or uninitialized value to discriminate between an error and having chosen a no-ECC situation. Add an "invalid" entry for this purpose. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-7-miquel.raynal@bootlin.com
This commit is contained in:
parent
dbc2f2e6d5
commit
86f2b225ad
2 changed files with 2 additions and 1 deletions
|
@ -5022,7 +5022,7 @@ static int of_get_nand_ecc_mode(struct device_node *np)
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(nand_ecc_modes); i++)
|
for (i = NAND_ECC_NONE; i < ARRAY_SIZE(nand_ecc_modes); i++)
|
||||||
if (!strcasecmp(pm, nand_ecc_modes[i]))
|
if (!strcasecmp(pm, nand_ecc_modes[i]))
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ struct nand_chip;
|
||||||
* Constants for ECC_MODES
|
* Constants for ECC_MODES
|
||||||
*/
|
*/
|
||||||
enum nand_ecc_mode {
|
enum nand_ecc_mode {
|
||||||
|
NAND_ECC_INVALID,
|
||||||
NAND_ECC_NONE,
|
NAND_ECC_NONE,
|
||||||
NAND_ECC_SOFT,
|
NAND_ECC_SOFT,
|
||||||
NAND_ECC_HW,
|
NAND_ECC_HW,
|
||||||
|
|
Loading…
Reference in a new issue