Merge tag 'sfi-removal-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / mtd / nand / raw / gpio.c
index eb03b8c..fb7a086 100644 (file)
@@ -164,7 +164,9 @@ static int gpio_nand_exec_op(struct nand_chip *chip,
 static int gpio_nand_attach_chip(struct nand_chip *chip)
 {
        chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
-       chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
+
+       if (chip->ecc.algo == NAND_ECC_ALGO_UNKNOWN)
+               chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
 
        return 0;
 }