Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252474
b: refs/heads/master
c: a2f812d
h: refs/heads/master
v: v3
  • Loading branch information
Brian Norris authored and David Woodhouse committed May 25, 2011
1 parent 283b0e7 commit 7b0f543
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a626743f579aa743473fd8b9215ca198bacf2ac4
refs/heads/master: a2f812df0b3d467db2ae5e3be38c36ff692ff99f
27 changes: 4 additions & 23 deletions trunk/drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1276,20 +1276,6 @@ int nand_update_bbt(struct mtd_info *mtd, loff_t offs)
* while scanning a device for factory marked good / bad blocks. */
static uint8_t scan_ff_pattern[] = { 0xff, 0xff };

static struct nand_bbt_descr smallpage_flashbased = {
.options = NAND_BBT_SCAN2NDPAGE,
.offs = NAND_SMALL_BADBLOCK_POS,
.len = 1,
.pattern = scan_ff_pattern
};

static struct nand_bbt_descr largepage_flashbased = {
.options = NAND_BBT_SCAN2NDPAGE,
.offs = NAND_LARGE_BADBLOCK_POS,
.len = 2,
.pattern = scan_ff_pattern
};

static uint8_t scan_agand_pattern[] = { 0x1C, 0x71, 0xC7, 0x1C, 0x71, 0xC7 };

static struct nand_bbt_descr agand_flashbased = {
Expand Down Expand Up @@ -1355,10 +1341,6 @@ static struct nand_bbt_descr bbt_mirror_no_bbt_descr = {
* this->badblock_pattern. Thus, this->badblock_pattern should be NULL when
* passed to this function.
*
* TODO: Handle other flags, replace other static structs
* (e.g. handle NAND_BBT_FLASH for flash-based BBT,
* replace smallpage_flashbased)
*
*/
static int nand_create_default_bbt_descr(struct nand_chip *this)
{
Expand Down Expand Up @@ -1422,15 +1404,14 @@ int nand_default_bbt(struct mtd_info *mtd)
this->bbt_md = &bbt_mirror_descr;
}
}
if (!this->badblock_pattern) {
this->badblock_pattern = (mtd->writesize > 512) ? &largepage_flashbased : &smallpage_flashbased;
}
} else {
this->bbt_td = NULL;
this->bbt_md = NULL;
if (!this->badblock_pattern)
nand_create_default_bbt_descr(this);
}

if (!this->badblock_pattern)
nand_create_default_bbt_descr(this);

return nand_scan_bbt(mtd, this->badblock_pattern);
}

Expand Down

0 comments on commit 7b0f543

Please sign in to comment.