diff options
Diffstat (limited to 'drivers/mtd/onenand/onenand_bbt.c')
-rw-r--r-- | drivers/mtd/onenand/onenand_bbt.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c index b2d7fc5ea25d..66fe3b7e7851 100644 --- a/drivers/mtd/onenand/onenand_bbt.c +++ b/drivers/mtd/onenand/onenand_bbt.c | |||
@@ -81,7 +81,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr | |||
81 | startblock = 0; | 81 | startblock = 0; |
82 | from = 0; | 82 | from = 0; |
83 | 83 | ||
84 | ops.mode = MTD_OOB_PLACE; | 84 | ops.mode = MTD_OPS_PLACE_OOB; |
85 | ops.ooblen = readlen; | 85 | ops.ooblen = readlen; |
86 | ops.oobbuf = buf; | 86 | ops.oobbuf = buf; |
87 | ops.len = ops.ooboffs = ops.retlen = ops.oobretlen = 0; | 87 | ops.len = ops.ooboffs = ops.retlen = ops.oobretlen = 0; |
@@ -154,7 +154,7 @@ static int onenand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) | |||
154 | block = (int) (onenand_block(this, offs) << 1); | 154 | block = (int) (onenand_block(this, offs) << 1); |
155 | res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03; | 155 | res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03; |
156 | 156 | ||
157 | 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", |
158 | (unsigned int) offs, block >> 1, res); | 158 | (unsigned int) offs, block >> 1, res); |
159 | 159 | ||
160 | switch ((int) res) { | 160 | switch ((int) res) { |
@@ -189,10 +189,8 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) | |||
189 | len = this->chipsize >> (this->erase_shift + 2); | 189 | len = this->chipsize >> (this->erase_shift + 2); |
190 | /* 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 */ |
191 | bbm->bbt = kzalloc(len, GFP_KERNEL); | 191 | bbm->bbt = kzalloc(len, GFP_KERNEL); |
192 | if (!bbm->bbt) { | 192 | if (!bbm->bbt) |
193 | printk(KERN_ERR "onenand_scan_bbt: Out of memory\n"); | ||
194 | return -ENOMEM; | 193 | return -ENOMEM; |
195 | } | ||
196 | 194 | ||
197 | /* Set the bad block position */ | 195 | /* Set the bad block position */ |
198 | bbm->badblockpos = ONENAND_BADBLOCK_POS; | 196 | bbm->badblockpos = ONENAND_BADBLOCK_POS; |