aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand/onenand_bbt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/onenand/onenand_bbt.c')
-rw-r--r--drivers/mtd/onenand/onenand_bbt.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c
index fc2c16a0fd1..66fe3b7e785 100644
--- a/drivers/mtd/onenand/onenand_bbt.c
+++ b/drivers/mtd/onenand/onenand_bbt.c
@@ -15,6 +15,7 @@
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/mtd/mtd.h> 16#include <linux/mtd/mtd.h>
17#include <linux/mtd/onenand.h> 17#include <linux/mtd/onenand.h>
18#include <linux/export.h>
18 19
19/** 20/**
20 * check_short_pattern - [GENERIC] check if a pattern is in the buffer 21 * check_short_pattern - [GENERIC] check if a pattern is in the buffer
@@ -80,7 +81,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
80 startblock = 0; 81 startblock = 0;
81 from = 0; 82 from = 0;
82 83
83 ops.mode = MTD_OOB_PLACE; 84 ops.mode = MTD_OPS_PLACE_OOB;
84 ops.ooblen = readlen; 85 ops.ooblen = readlen;
85 ops.oobbuf = buf; 86 ops.oobbuf = buf;
86 ops.len = ops.ooboffs = ops.retlen = ops.oobretlen = 0; 87 ops.len = ops.ooboffs = ops.retlen = ops.oobretlen = 0;
@@ -153,7 +154,7 @@ static int onenand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt)
153 block = (int) (onenand_block(this, offs) << 1); 154 block = (int) (onenand_block(this, offs) << 1);
154 res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03; 155 res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03;
155 156
156 DEBUG(MTD_DEBUG_LEVEL2, "onenand_isbad_bbt: bbt info for offs 0x%08x: (block %d) 0x%02x\n", 157 pr_debug("onenand_isbad_bbt: bbt info for offs 0x%08x: (block %d) 0x%02x\n",
157 (unsigned int) offs, block >> 1, res); 158 (unsigned int) offs, block >> 1, res);
158 159
159 switch ((int) res) { 160 switch ((int) res) {
@@ -188,10 +189,8 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
188 len = this->chipsize >> (this->erase_shift + 2); 189 len = this->chipsize >> (this->erase_shift + 2);
189 /* Allocate memory (2bit per block) and clear the memory bad block table */ 190 /* Allocate memory (2bit per block) and clear the memory bad block table */
190 bbm->bbt = kzalloc(len, GFP_KERNEL); 191 bbm->bbt = kzalloc(len, GFP_KERNEL);
191 if (!bbm->bbt) { 192 if (!bbm->bbt)
192 printk(KERN_ERR "onenand_scan_bbt: Out of memory\n");
193 return -ENOMEM; 193 return -ENOMEM;
194 }
195 194
196 /* Set the bad block position */ 195 /* Set the bad block position */
197 bbm->badblockpos = ONENAND_BADBLOCK_POS; 196 bbm->badblockpos = ONENAND_BADBLOCK_POS;