| From 898b8632023c02f1f8de8decaada70e4fd4c25e7 Mon Sep 17 00:00:00 2001 |
| From: Avery Pennarun <apenwarr@gmail.com> |
| Date: Sat, 11 Jul 2015 17:55:56 -0400 |
| Subject: [PATCH] libmtd: MLC NAND, not just normal NAND, can have bad blocks. |
| |
| --- |
| lib/libmtd.c | 5 ++++- |
| 1 file changed, 4 insertions(+), 1 deletion(-) |
| |
| diff --git a/lib/libmtd.c b/lib/libmtd.c |
| index 054f4c0..4c7716e 100644 |
| --- a/lib/libmtd.c |
| +++ b/lib/libmtd.c |
| @@ -403,6 +403,8 @@ static int type_str2int(const char *str) |
| { |
| if (!strcmp(str, "nand")) |
| return MTD_NANDFLASH; |
| + if (!strcmp(str, "mlc-nand")) |
| + return MTD_MLCNANDFLASH; |
| if (!strcmp(str, "nor")) |
| return MTD_NORFLASH; |
| if (!strcmp(str, "rom")) |
| @@ -768,7 +770,8 @@ int mtd_get_dev_info1(libmtd_t desc, int mtd_num, struct mtd_dev_info *mtd) |
| |
| mtd->eb_cnt = mtd->size / mtd->eb_size; |
| mtd->type = type_str2int(mtd->type_str); |
| - mtd->bb_allowed = !!(mtd->type == MTD_NANDFLASH); |
| + mtd->bb_allowed = (mtd->type == MTD_NANDFLASH || |
| + mtd->type == MTD_MLCNANDFLASH); |
| |
| return 0; |
| } |
| -- |
| 2.4.3.573.g4eafbef |
| |