Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41ce9214 authored by Artem B. Bityuckiy's avatar Artem B. Bityuckiy Committed by Thomas Gleixner
Browse files

[MTD] NAND: Allow operation without bad block table



Small bugfix. Sometimes it may be handy not to have bbt.
So, this->bbt might be NULL.

Signed-off-by: default avatarArtem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 0040bf38
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@
 *	The AG-AND chips have nice features for speed improvement,
 *	which are not supported yet. Read / program 4 pages in one go.
 *
 * $Id: nand_base.c,v 1.131 2005/02/09 12:19:56 gleixner Exp $
 * $Id: nand_base.c,v 1.132 2005/02/09 14:49:56 dedekind Exp $
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
@@ -461,6 +461,7 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
	
	/* Get block number */
	block = ((int) ofs) >> this->bbt_erase_shift;
	if (this->bbt)
		this->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);

	/* Do we have a flash based bad block table ? */