mtd: mtd: drop NAND_ECC_SOFT_BCH enum value
authorRafał Miłecki <zajec5@gmail.com>
Sun, 17 Apr 2016 20:53:07 +0000 (22:53 +0200)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 5 May 2016 21:55:13 +0000 (23:55 +0200)
This value should not be part of nand_ecc_modes_t as it specifies
algorithm not a mode. We successfully managed to introduce new "algo"
field which is respected now.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/fsmc_nand.c
drivers/mtd/nand/jz4780_nand.c
drivers/mtd/nand/mxc_nand.c
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nandsim.c
drivers/mtd/nand/sunxi_nand.c
include/linux/mtd/nand.h

index 0f8c63f85f86fe70a775ee09c768a1cfd4c693aa..d4f454a4b35e7e5ed8aff7a6d5a326c86d62032f 100644 (file)
@@ -959,7 +959,6 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
                        break;
 
                case NAND_ECC_SOFT:
-               case NAND_ECC_SOFT_BCH:
                        if (nand->ecc.algo == NAND_ECC_BCH) {
                                dev_info(&pdev->dev, "Using 4-bit SW BCH ECC scheme\n");
                                break;
@@ -974,7 +973,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
                 * Don't set layout for BCH4 SW ECC. This will be
                 * generated later in nand_bch_init() later.
                 */
-               if (nand->ecc.mode != NAND_ECC_SOFT_BCH) {
+               if (nand->ecc.mode == NAND_ECC_HW) {
                        switch (mtd->oobsize) {
                        case 16:
                        case 64:
index 10f249ac148c9b467aa36c43d490c3dc018cc19d..daf3c4217f4deb034a4e952cb75a237f07c7bf43 100644 (file)
@@ -179,7 +179,6 @@ static int jz4780_nand_init_ecc(struct jz4780_nand_chip *nand, struct device *de
                chip->ecc.correct = jz4780_nand_ecc_correct;
                /* fall through */
        case NAND_ECC_SOFT:
-       case NAND_ECC_SOFT_BCH:
                dev_info(dev, "using %s (strength %d, size %d, bytes %d)\n",
                        (nfc->bch) ? "hardware BCH" : "software ECC",
                        chip->ecc.strength, chip->ecc.size, chip->ecc.bytes);
index aa0ba4b99395deb64cf757962e67663c80939ed5..5173fadc9a4e637f01817ed040a42b72af1d7a68 100644 (file)
@@ -1625,7 +1625,6 @@ static int mxcnd_probe(struct platform_device *pdev)
                break;
 
        case NAND_ECC_SOFT:
-       case NAND_ECC_SOFT_BCH:
                break;
 
        default:
index 1d74b802aa0a5e4c271113cb15710f18384199cb..c9d6230eab08ee349b9fc0cc88be38394bb0043f 100644 (file)
@@ -4183,8 +4183,7 @@ static int nand_set_ecc_soft_ops(struct mtd_info *mtd)
        struct nand_chip *chip = mtd_to_nand(mtd);
        struct nand_ecc_ctrl *ecc = &chip->ecc;
 
-       if (WARN_ON(ecc->mode != NAND_ECC_SOFT &&
-                   ecc->mode != NAND_ECC_SOFT_BCH))
+       if (WARN_ON(ecc->mode != NAND_ECC_SOFT))
                return -EINVAL;
 
        switch (ecc->algo) {
@@ -4331,8 +4330,7 @@ int nand_scan_tail(struct mtd_info *mtd)
         * If no default placement scheme is given, select an appropriate one.
         */
        if (!mtd->ooblayout &&
-           !((ecc->mode == NAND_ECC_SOFT || ecc->mode == NAND_ECC_SOFT_BCH) &&
-              ecc->algo == NAND_ECC_BCH)) {
+           !(ecc->mode == NAND_ECC_SOFT && ecc->algo == NAND_ECC_BCH)) {
                switch (mtd->oobsize) {
                case 8:
                case 16:
@@ -4426,7 +4424,6 @@ int nand_scan_tail(struct mtd_info *mtd)
                ecc->algo = NAND_ECC_HAMMING;
 
        case NAND_ECC_SOFT:
-       case NAND_ECC_SOFT_BCH:
                ret = nand_set_ecc_soft_ops(mtd);
                if (ret) {
                        ret = -EINVAL;
@@ -4514,7 +4511,6 @@ int nand_scan_tail(struct mtd_info *mtd)
        /* Large page NAND with SOFT_ECC should support subpage reads */
        switch (ecc->mode) {
        case NAND_ECC_SOFT:
-       case NAND_ECC_SOFT_BCH:
                if (chip->page_shift > 9)
                        chip->options |= NAND_SUBPAGE_READ;
                break;
@@ -4614,8 +4610,7 @@ void nand_release(struct mtd_info *mtd)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
 
-       if ((chip->ecc.mode == NAND_ECC_SOFT ||
-            chip->ecc.mode == NAND_ECC_SOFT_BCH) &&
+       if (chip->ecc.mode == NAND_ECC_SOFT &&
            chip->ecc.algo == NAND_ECC_BCH)
                nand_bch_free((struct nand_bch_control *)chip->ecc.priv);
 
index 66eebb9e77f3df17d4b356146d4e86b4cb59375b..794745dff7f18c882f7ba868a178c7527e7fb233 100644 (file)
@@ -2339,7 +2339,7 @@ static int __init ns_init_module(void)
                        retval = -EINVAL;
                        goto error;
                }
-               chip->ecc.mode = NAND_ECC_SOFT_BCH;
+               chip->ecc.mode = NAND_ECC_SOFT;
                chip->ecc.algo = NAND_ECC_BCH;
                chip->ecc.size = 512;
                chip->ecc.strength = bch;
index 1baf8983621063c5328df647a360468c7777b896..a83a690688b45067a318ef14ed97970c588bb018 100644 (file)
@@ -1612,8 +1612,6 @@ static int sunxi_nand_ecc_init(struct mtd_info *mtd, struct nand_ecc_ctrl *ecc,
                return -EINVAL;
 
        switch (ecc->mode) {
-       case NAND_ECC_SOFT_BCH:
-               break;
        case NAND_ECC_HW:
                ret = sunxi_nand_hw_ecc_ctrl_init(mtd, ecc, np);
                if (ret)
index e851839daf0937fe9ab3458102e80e4a2af273e2..fbe8e164a4ee93db99fab879c7284721546204e8 100644 (file)
@@ -116,7 +116,6 @@ typedef enum {
        NAND_ECC_HW,
        NAND_ECC_HW_SYNDROME,
        NAND_ECC_HW_OOB_FIRST,
-       NAND_ECC_SOFT_BCH,
 } nand_ecc_modes_t;
 
 enum nand_ecc_algo {