[U-Boot] [PATCH v2 3/3] atmel_nand: use the definition: PMECC_OOB_RESERVED_BYTES instead magic number

Wenyou Yang wenyou.yang at atmel.com
Mon Jan 25 07:06:35 CET 2016


From: Josh Wu <josh.wu at atmel.com>

As atmel_nand_ecc.h is sync with v4.1 kernel, which adds the
PMECC_OOB_RESERVED_BYTES. So use it in the driver.

Signed-off-by: Josh Wu <josh.wu at atmel.com>
Reviewed-by: Andreas Bießmann <andreas.devel at googlemail.com>
Signed-off-by: Wenyou Yang <wenyou.yang at atmel.com>
---

Changes in v2:
 - following Andreas' advice, change the message for more concise.
 - collect the Reviewed-by from Andreas.
 - drop a patch:
	[PATCH 3/4] atmel_nand: increase more delay to support MT29F32G08CBADA

 drivers/mtd/nand/atmel_nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 852883b..73fd403 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -901,7 +901,7 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand,
 			return -EINVAL;
 		}
 
-		if (nand->ecc.bytes > mtd->oobsize - 2) {
+		if (nand->ecc.bytes > mtd->oobsize - PMECC_OOB_RESERVED_BYTES) {
 			dev_err(host->dev, "No room for ECC bytes\n");
 			return -EINVAL;
 		}
-- 
1.7.9.5



More information about the U-Boot mailing list