]> www.infradead.org Git - mtd-utils.git/commitdiff
check the MLC nand type
authorHuang Shijie <b32955@freescale.com>
Tue, 20 Aug 2013 05:58:37 +0000 (13:58 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 22 Oct 2013 23:19:23 +0000 (16:19 -0700)
In the current code, the MTD_NANDFLASH stands for both the SLC and MLC.

In the kernel, the MTD_NANDFLASH only stands for the SLC now,
so in order to keep the logic unchanged, we should also check the MLC
NAND by MTD_MLCNANDFLASH.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
lib/libmtd.c
ubi-utils/mtdinfo.c

index 3e8109aa6c8a0a2de46aa742925b2ae681cde0bf..2089373e15eafc562b58855a5fb6f73f338c3c2c 100644 (file)
@@ -776,7 +776,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;
 }
index a9dc6752a7c4e4d97640f3c067f7dd6acd750bff..5ac95aaabb8af931480dac4696ae9354a8828334 100644 (file)
@@ -315,7 +315,7 @@ static int print_dev_info(libmtd_t libmtd, const struct mtd_info *mtd_info, int
                printf("Sub-page size:                  %d %s\n",
                       mtd.subpage_size,
                       mtd.subpage_size > 1 ? "bytes" : "byte");
-       else if (mtd.type == MTD_NANDFLASH)
+       else if (mtd.type == MTD_NANDFLASH || mtd.type == MTD_MLCNANDFLASH)
                printf("Sub-page size:                  unknown\n");
 
        if (mtd.oob_size > 0)