mtd: rawnand: xway: Do not force a particular software ECC engine
[linux-2.6-microblaze.git] / drivers / mtd / nand / raw / xway_nand.c
index efc5bf5..2675197 100644 (file)
@@ -149,7 +149,9 @@ static void xway_write_buf(struct nand_chip *chip, const u_char *buf, int len)
 static int xway_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;
 }