mtd: nand: samsung: warn about un-parseable ECC info

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Jun 1 11:59:01 PDT 2017


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d24197907454b902908e025bce4b8bc677d3ba6b
Commit:     d24197907454b902908e025bce4b8bc677d3ba6b
Parent:     787710492911e21148975e1d1914c7409fb32c7e
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Mon May 1 17:04:55 2017 -0700
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon May 22 09:42:29 2017 +0200

    mtd: nand: samsung: warn about un-parseable ECC info
    
    We don't handle cases larger than 7. We probably shouldn't pretend we
    know the ECC step size in this case, and it's probably also good to
    WARN() like we do in many other similar cases.
    
    Fixes: 8fc82d456e40 ("mtd: nand: samsung: Retrieve ECC requirements from extended ID")
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
 drivers/mtd/nand/nand_samsung.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/nand_samsung.c b/drivers/mtd/nand/nand_samsung.c
index 9cfc403..1e07559 100644
--- a/drivers/mtd/nand/nand_samsung.c
+++ b/drivers/mtd/nand/nand_samsung.c
@@ -84,6 +84,9 @@ static void samsung_nand_decode_id(struct nand_chip *chip)
 			case 7:
 				chip->ecc_strength_ds = 60;
 				break;
+			default:
+				WARN(1, "Could not decode ECC info");
+				chip->ecc_step_ds = 0;
 			}
 		}
 	} else {



More information about the linux-mtd-cvs mailing list