]> git.sur5r.net Git - u-boot/commitdiff
nand: arasan_nfc: Move common ecc struct initialization init routine
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Thu, 4 Jan 2018 10:34:20 +0000 (16:04 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 30 Jan 2018 13:29:07 +0000 (14:29 +0100)
Move common part of ecc structure initialization to
arasan_nand_init() routine.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/mtd/nand/arasan_nfc.c

index 14b27337b68ac96739efcbe27b0d96b3fe430a75..dc956f81e49b726c03e26cb56430f97f03e7b3b9 100644 (file)
@@ -1038,13 +1038,6 @@ static int arasan_nand_ecc_init(struct mtd_info *mtd)
        u32 regval, eccpos_start, i;
        struct nand_chip *nand_chip = mtd_to_nand(mtd);
 
-       nand_chip->ecc.mode = NAND_ECC_HW;
-       nand_chip->ecc.hwctl = NULL;
-       nand_chip->ecc.read_page = arasan_nand_read_page_hwecc;
-       nand_chip->ecc.write_page = arasan_nand_write_page_hwecc;
-       nand_chip->ecc.read_oob = arasan_nand_read_oob;
-       nand_chip->ecc.write_oob = arasan_nand_write_oob;
-
        for (i = 0; i < ARRAY_SIZE(ecc_matrix); i++) {
                if ((ecc_matrix[i].pagesize == mtd->writesize) &&
                    (ecc_matrix[i].ecc_codeword_size >=
@@ -1126,6 +1119,13 @@ static int arasan_nand_init(struct nand_chip *nand_chip, int devnum)
                goto fail;
        }
 
+       nand_chip->ecc.mode = NAND_ECC_HW;
+       nand_chip->ecc.hwctl = NULL;
+       nand_chip->ecc.read_page = arasan_nand_read_page_hwecc;
+       nand_chip->ecc.write_page = arasan_nand_write_page_hwecc;
+       nand_chip->ecc.read_oob = arasan_nand_read_oob;
+       nand_chip->ecc.write_oob = arasan_nand_write_oob;
+
        if (arasan_nand_ecc_init(mtd)) {
                printf("%s: nand_ecc_init failed\n", __func__);
                goto fail;