]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/nand/nand_ecc.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[linux-2.6-omap-h63xx.git] / drivers / mtd / nand / nand_ecc.c
index dd438ca47d9ab46a1978483ffa0c5ce5b239c04a..918a806a8471f7aaa1b68b29e5e401a15737d4a4 100644 (file)
@@ -9,8 +9,6 @@
  *
  * Copyright (C) 2006 Thomas Gleixner <tglx@linutronix.de>
  *
- * $Id: nand_ecc.c,v 1.15 2005/11/07 11:14:30 gleixner Exp $
- *
  * This file is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * Free Software Foundation; either version 2 or (at your option) any
@@ -112,7 +110,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
@@ -148,7 +146,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];
@@ -189,7 +187,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);