[U-Boot] [PATCH 1/4] OneNAND: Move largepage_memorybased

Marek Vasut marek.vasut at gmail.com
Sat Oct 2 19:33:56 CEST 2010


This moves "struct nand_bbt_descr largepage_memorybased" into
"onenand_default_bbt" as that's the only place where this is used.

This also removes an entry from .data section. (For me, this section disappears
after relocation).

Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
---
 drivers/mtd/onenand/onenand_bbt.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c
index 1354877..c5d3905 100644
--- a/drivers/mtd/onenand/onenand_bbt.c
+++ b/drivers/mtd/onenand/onenand_bbt.c
@@ -227,19 +227,6 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
 	return ret;
 }
 
-/*
- * Define some generic bad / good block scan pattern which are used
- * while scanning a device for factory marked good / bad blocks.
- */
-static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
-
-static struct nand_bbt_descr largepage_memorybased = {
-	.options = 0,
-	.offs = 0,
-	.len = 2,
-	.pattern = scan_ff_pattern,
-};
-
 /**
  * onenand_default_bbt - [OneNAND Interface] Select a default bad block table for the device
  * @param mtd		MTD device structure
@@ -252,6 +239,18 @@ int onenand_default_bbt(struct mtd_info *mtd)
 	struct onenand_chip *this = mtd->priv;
 	struct bbm_info *bbm;
 
+	/*
+	 * Define some generic bad / good block scan pattern which are used
+	 * while scanning a device for factory marked good / bad blocks.
+	 */
+	uint8_t scan_ff_pattern[] = { 0xff, 0xff };
+	struct nand_bbt_descr largepage_memorybased = {
+		.options = 0,
+		.offs = 0,
+		.len = 2,
+		.pattern = scan_ff_pattern,
+	};
+
 	this->bbm = malloc(sizeof(struct bbm_info));
 	if (!this->bbm)
 		return -ENOMEM;
-- 
1.7.1



More information about the U-Boot mailing list