Merge branches 'release', 'asus', 'sony-laptop' and 'thinkpad' into release
[pandora-kernel.git] / drivers / mtd / nand / nand_ecc.c
index 2a163e4..9003a13 100644 (file)
@@ -65,8 +65,7 @@ static const u_char nand_ecc_precalc_table[] = {
 };
 
 /**
- * nand_calculate_ecc - [NAND Interface] Calculate 3 byte ECC code
- *                     for 256 byte block
+ * nand_calculate_ecc - [NAND Interface] Calculate 3-byte ECC for 256-byte block
  * @mtd:       MTD block structure
  * @dat:       raw data
  * @ecc_code:  buffer for ECC
@@ -113,7 +112,7 @@ int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
        tmp2 |= (reg2 & 0x01) << 0; /* B7 -> B0 */
 
        /* Calculate final ECC code */
-#ifdef CONFIG_NAND_ECC_SMC
+#ifdef CONFIG_MTD_NAND_ECC_SMC
        ecc_code[0] = ~tmp2;
        ecc_code[1] = ~tmp1;
 #else
@@ -149,7 +148,7 @@ int nand_correct_data(struct mtd_info *mtd, u_char *dat,
 {
        uint8_t s0, s1, s2;
 
-#ifdef CONFIG_NAND_ECC_SMC
+#ifdef CONFIG_MTD_NAND_ECC_SMC
        s0 = calc_ecc[0] ^ read_ecc[0];
        s1 = calc_ecc[1] ^ read_ecc[1];
        s2 = calc_ecc[2] ^ read_ecc[2];
@@ -190,7 +189,7 @@ int nand_correct_data(struct mtd_info *mtd, u_char *dat,
        if(countbits(s0 | ((uint32_t)s1 << 8) | ((uint32_t)s2 <<16)) == 1)
                return 1;
 
-       return -1;
+       return -EBADMSG;
 }
 EXPORT_SYMBOL(nand_correct_data);