[PATCH 1/1] atmel_nand: disable hardware ecc if not enable

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Jan 16 11:10:25 EST 2012


allow to save 1360 bytes

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 drivers/mtd/nand/atmel_nand.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 3213de2..0533759 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -374,7 +374,8 @@ static int __init atmel_nand_probe(struct device_d *dev)
 
 	nand_chip->ecc.mode = NAND_ECC_SOFT;
 
-	if (pdata->ecc_mode == NAND_ECC_HW) {
+	if (IS_ENABLED(CONFIG_NAND_ECC_HW) &&
+	    pdata->ecc_mode == NAND_ECC_HW) {
 		host->ecc = dev_request_mem_region(dev, 1);
 
 		if (!host->ecc)
@@ -412,7 +413,8 @@ static int __init atmel_nand_probe(struct device_d *dev)
 		goto err_scan_ident;
 	}
 
-	if (nand_chip->ecc.mode == NAND_ECC_HW) {
+	if (IS_ENABLED(CONFIG_NAND_ECC_HW) &&
+	    nand_chip->ecc.mode == NAND_ECC_HW) {
 		/* ECC is calculated for the whole page (1 step) */
 		nand_chip->ecc.size = mtd->writesize;
 
-- 
1.7.7




More information about the barebox mailing list