Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1380788

[PATCH V2 08/11] mtd: nand: fsmc: validate ECC setup by checking algorithm directly

From Rafał Miłecki <zajec5@gmail.com>
Newsgroups linux.kernel
Subject [PATCH V2 08/11] mtd: nand: fsmc: validate ECC setup by checking algorithm directly
Date 2016-04-17 19:20 +0200
Message-ID <roYwz-7T4-15@gated-at.bofh.it> (permalink)
References <roi4i-8kL-5@gated-at.bofh.it> <roYwy-7T4-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


NAND core sets ECC algorithm in algo field now and it should be
preferred over the mode field. This also prepares driver for dropping
NAND_ECC_SOFT_BCH.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
 drivers/mtd/nand/fsmc_nand.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 1372040..0f8c63f 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -958,9 +958,12 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 			nand->ecc.strength = 1;
 			break;
 
+		case NAND_ECC_SOFT:
 		case NAND_ECC_SOFT_BCH:
-			dev_info(&pdev->dev, "Using 4-bit SW BCH ECC scheme\n");
-			break;
+			if (nand->ecc.algo == NAND_ECC_BCH) {
+				dev_info(&pdev->dev, "Using 4-bit SW BCH ECC scheme\n");
+				break;
+			}
 
 		default:
 			dev_err(&pdev->dev, "Unsupported ECC mode!\n");
-- 
1.8.4.5

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH V2 08/11] mtd: nand: fsmc: validate ECC setup by checking algorithm directly Rafał Miłecki <zajec5@gmail.com> - 2016-04-17 19:20 +0200

csiph-web