Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332679
b: refs/heads/master
c: 7b5a2d4
h: refs/heads/master
i:
  332677: 16a4eeb
  332675: be7c8c1
  332671: 98c4c07
v: v3
  • Loading branch information
Brian Norris authored and David Woodhouse committed Sep 29, 2012
1 parent d194011 commit 3beef21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 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: e47f68587b8255410e79166cbdecae290ca8a84e
refs/heads/master: 7b5a2d40978fbb046b99b4030ce2785b66a451a5
19 changes: 8 additions & 11 deletions trunk/drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ static u32 bbt_get_ver_offs(struct mtd_info *mtd, struct nand_bbt_descr *td)
* Read the bad block table(s) for all chips starting at a given page. We
* assume that the bbt bits are in consecutive order.
*/
static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
struct nand_bbt_descr *td, struct nand_bbt_descr *md)
static void read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
struct nand_bbt_descr *td, struct nand_bbt_descr *md)
{
struct nand_chip *this = mtd->priv;

Expand All @@ -392,7 +392,6 @@ static int read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
pr_info("Bad block table at page %d, version 0x%02X\n",
md->pages[0], md->version[0]);
}
return 1;
}

/* Scan a given block full */
Expand Down Expand Up @@ -623,17 +622,16 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
*
* Search and read the bad block table(s).
*/
static int search_read_bbts(struct mtd_info *mtd, uint8_t * buf, struct nand_bbt_descr *td, struct nand_bbt_descr *md)
static void search_read_bbts(struct mtd_info *mtd, uint8_t *buf,
struct nand_bbt_descr *td,
struct nand_bbt_descr *md)
{
/* Search the primary table */
search_bbt(mtd, buf, td);

/* Search the mirror table */
if (md)
search_bbt(mtd, buf, md);

/* Force result check */
return 1;
}

/**
Expand Down Expand Up @@ -1159,14 +1157,13 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)

/* Is the bbt at a given page? */
if (td->options & NAND_BBT_ABSPAGE) {
res = read_abs_bbts(mtd, buf, td, md);
read_abs_bbts(mtd, buf, td, md);
} else {
/* Search the bad block table using a pattern in oob */
res = search_read_bbts(mtd, buf, td, md);
search_read_bbts(mtd, buf, td, md);
}

if (res)
res = check_create(mtd, buf, bd);
res = check_create(mtd, buf, bd);

/* Prevent the bbt regions from erasing / writing */
mark_bbt_region(mtd, td);
Expand Down

0 comments on commit 3beef21

Please sign in to comment.