]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/onenand/onenand_bbt.c
mtd: nand: omap_gpmc: Fix update of read_ecc in oob
[u-boot] / drivers / mtd / onenand / onenand_bbt.c
index 1354877729d9aa8a8d4814b1a414b8c02687dfb3..0267c2c5c90a8b7f8b0bba69422638e625c22c0c 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <common.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/onenand.h>
 #include <malloc.h>
@@ -87,7 +87,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t * buf,
        startblock = 0;
        from = 0;
 
-       ops.mode = MTD_OOB_PLACE;
+       ops.mode = MTD_OPS_PLACE_OOB;
        ops.ooblen = readlen;
        ops.oobbuf = buf;
        ops.len = ops.ooboffs = ops.retlen = ops.oobretlen = 0;
@@ -200,10 +200,8 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
        len = this->chipsize >> (this->erase_shift + 2);
        /* Allocate memory (2bit per block) */
        bbm->bbt = malloc(len);
-       if (!bbm->bbt) {
-               printk(KERN_ERR "onenand_scan_bbt: Out of memory\n");
+       if (!bbm->bbt)
                return -ENOMEM;
-       }
        /* Clear the memory bad block table */
        memset(bbm->bbt, 0x00, len);