Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
[powerpc.git] / drivers / mtd / nand / diskonchip.c
index 2ec9080..595208f 100644 (file)
@@ -114,7 +114,7 @@ module_param(no_autopart, int, 0);
 static int show_firmware_partition = 0;
 module_param(show_firmware_partition, int, 0);
 
-#ifdef MTD_NAND_DISKONCHIP_BBTWRITE
+#ifdef CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE
 static int inftl_bbt_write = 1;
 #else
 static int inftl_bbt_write = 0;
@@ -464,7 +464,7 @@ static void __init doc2000_count_chips(struct mtd_info *mtd)
        printk(KERN_DEBUG "Detected %d chips per floor.\n", i);
 }
 
-static int doc200x_wait(struct mtd_info *mtd, struct nand_chip *this, int state)
+static int doc200x_wait(struct mtd_info *mtd, struct nand_chip *this)
 {
        struct doc_priv *doc = this->priv;
 
@@ -968,12 +968,14 @@ static int doc200x_calculate_ecc(struct mtd_info *mtd, const u_char *dat, unsign
        return 0;
 }
 
-static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc)
+static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat,
+                               u_char *read_ecc, u_char *isnull)
 {
        int i, ret = 0;
        struct nand_chip *this = mtd->priv;
        struct doc_priv *doc = this->priv;
        void __iomem *docptr = doc->virtadr;
+       uint8_t calc_ecc[6];
        volatile u_char dummy;
        int emptymatch = 1;
 
@@ -1056,8 +1058,7 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_
  * safer.  The only problem with it is that any code that parses oobfree must
  * be able to handle out-of-order segments.
  */
-static struct nand_oobinfo doc200x_oobinfo = {
-       .useecc = MTD_NANDECC_AUTOPLACE,
+static struct nand_ecclayout doc200x_oobinfo = {
        .eccbytes = 6,
        .eccpos = {0, 1, 2, 3, 4, 5},
        .oobfree = {{8, 8}, {6, 2}}
@@ -1634,13 +1635,12 @@ static int __init doc_probe(unsigned long physadr)
 
        len = sizeof(struct mtd_info) +
            sizeof(struct nand_chip) + sizeof(struct doc_priv) + (2 * sizeof(struct nand_bbt_descr));
-       mtd = kmalloc(len, GFP_KERNEL);
+       mtd = kzalloc(len, GFP_KERNEL);
        if (!mtd) {
                printk(KERN_ERR "DiskOnChip kmalloc (%d bytes) failed!\n", len);
                ret = -ENOMEM;
                goto fail;
        }
-       memset(mtd, 0, len);
 
        nand                    = (struct nand_chip *) (mtd + 1);
        doc                     = (struct doc_priv *) (nand + 1);
@@ -1660,11 +1660,11 @@ static int __init doc_probe(unsigned long physadr)
        nand->ecc.calculate     = doc200x_calculate_ecc;
        nand->ecc.correct       = doc200x_correct_data;
 
-       nand->autooob           = &doc200x_oobinfo;
+       nand->ecc.layout        = &doc200x_oobinfo;
        nand->ecc.mode          = NAND_ECC_HW_SYNDROME;
        nand->ecc.size          = 512;
        nand->ecc.bytes         = 6;
-       nand->options           = NAND_USE_FLASH_BBT | NAND_HWECC_SYNDROME;
+       nand->options           = NAND_USE_FLASH_BBT;
 
        doc->physadr            = physadr;
        doc->virtadr            = virtadr;