Skip to content

Commit b8f8068

Browse files
computersforpeacededekind
authored andcommitted
mtd: nand: move NAND_CREATE_EMPTY_BBT flag
The NAND_CREATE_EMPTY_BBT flag was added by commit: 453281a mtd: nand: introduce NAND_CREATE_EMPTY_BBT This flag is not used within the kernel and not explained well, so I took the liberty to edit its comments. Also, this is a BBT-related flag (and closely tied with NAND_BBT_CREATE) so I'm moving it to bbm.h next to NAND_BBT_CREATE, thus requiring that we use the flag in nand_chip.bbt_options, *not* in nand_chip.options. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
1 parent bb9ebd4 commit b8f8068

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎drivers/mtd/nand/nand_bbt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static int check_create(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_desc
970970
continue;
971971

972972
/* Create the table in memory by scanning the chip(s) */
973-
if (!(this->options & NAND_CREATE_EMPTY_BBT))
973+
if (!(this->bbt_options & NAND_CREATE_EMPTY_BBT))
974974
create_bbt(mtd, buf, bd, chipsel);
975975

976976
td->version[i] = 1;

‎include/linux/mtd/bbm.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ struct nand_bbt_descr {
8686
#define NAND_BBT_VERSION 0x00000100
8787
/* Create a bbt if none exists */
8888
#define NAND_BBT_CREATE 0x00000200
89+
/*
90+
* Create an empty BBT with no vendor information. Vendor's information may be
91+
* unavailable, for example, if the NAND controller has a different data and OOB
92+
* layout or if this information is already purged. Must be used in conjunction
93+
* with NAND_BBT_CREATE.
94+
*/
95+
#define NAND_CREATE_EMPTY_BBT 0x01000000
8996
/* Search good / bad pattern through all pages of a block */
9097
#define NAND_BBT_SCANALLPAGES 0x00000400
9198
/* Scan block empty during good / bad block scan */

‎include/linux/mtd/nand.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ typedef enum {
228228
#define NAND_OWN_BUFFERS 0x00040000
229229
/* Chip may not exist, so silence any errors in scan */
230230
#define NAND_SCAN_SILENT_NODEV 0x00080000
231-
/* Create an empty BBT with no vendor information if the BBT is available */
232-
#define NAND_CREATE_EMPTY_BBT 0x01000000
233231

234232
/* Options set by nand scan */
235233
/* Nand scan has allocated controller struct */

0 commit comments

Comments
 (0)