]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: nand: samsung: warn about un-parseable ECC info
authorBrian Norris <computersforpeace@gmail.com>
Tue, 2 May 2017 00:04:55 +0000 (17:04 -0700)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Mon, 22 May 2017 07:42:29 +0000 (09:42 +0200)
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@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/nand_samsung.c

index 9cfc4035a420a3eae2d2a451c97f5300f8bc8b80..1e0755997762aa23ee953ad20f2a88d24dc7139c 100644 (file)
@@ -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 {