mtd: nand: davinci: set ECC algorithm explicitly

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon May 23 21:59:23 PDT 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=867f9873fef69414355e2e1ef547f9b080c3fd69
Commit:     867f9873fef69414355e2e1ef547f9b080c3fd69
Parent:     04dae62c89bd6e754518f9dcffac480e39f28758
Author:     Rafał Miłecki <zajec5 at gmail.com>
AuthorDate: Sun Apr 17 22:52:58 2016 +0200
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Thu May 5 23:52:02 2016 +0200

    mtd: nand: davinci: set ECC algorithm explicitly
    
    This is part of process deprecating NAND_ECC_SOFT_BCH (and switching to
    enum nand_ecc_algo).
    
    Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
 drivers/mtd/nand/davinci_nand.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 0198536..cc07ba0 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -723,8 +723,17 @@ static int nand_davinci_probe(struct platform_device *pdev)
 
 	switch (info->chip.ecc.mode) {
 	case NAND_ECC_NONE:
+		pdata->ecc_bits = 0;
+		break;
 	case NAND_ECC_SOFT:
 		pdata->ecc_bits = 0;
+		/*
+		 * This driver expects Hamming based ECC when ecc_mode is set
+		 * to NAND_ECC_SOFT. Force ecc.algo to NAND_ECC_HAMMING to
+		 * avoid adding an extra ->ecc_algo field to
+		 * davinci_nand_pdata.
+		 */
+		info->chip.ecc.algo = NAND_ECC_HAMMING;
 		break;
 	case NAND_ECC_HW:
 		if (pdata->ecc_bits == 4) {



More information about the linux-mtd-cvs mailing list