yaffs: fix to detect MLC/TLC NAND flash
authorVladimir Zahradnik <vladimir.zahradnik@gmail.com>
Sat, 24 Dec 2016 23:20:17 +0000 (00:20 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 6 Jan 2017 14:34:13 +0000 (15:34 +0100)
Signed-off-by: Vladimir Zahradnik <vladimir.zahradnik@gmail.com>
target/linux/generic/files/fs/yaffs2/yaffs_mtdif.c
target/linux/generic/files/fs/yaffs2/yaffs_vfs.c

index 7c01461ab93de21de9e5e272ec5bcfd58504255c..d15c6606380e31550b0db901e65bf94ba0445fcd 100644 (file)
@@ -259,7 +259,7 @@ struct mtd_info * yaffs_get_mtd_device(dev_t sdev)
                return NULL;    /* This isn't an mtd device */
 
        /* Check it's NAND */
-       if (mtd->type != MTD_NANDFLASH) {
+       if (mtd->type != MTD_NANDFLASH && mtd->type != MTD_MLCNANDFLASH) {
                yaffs_trace(YAFFS_TRACE_ALWAYS,
                        "yaffs: MTD device is not NAND it's type %d",
                        mtd->type);
index 864a5dc185c93b3c92534363e4855b908f8fe642..73dcc3ca8cee017fed7f8890af82f26ce2eaa224 100644 (file)
@@ -2598,7 +2598,7 @@ static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
        }
 
        /* Check it's NAND */
-       if (mtd->type != MTD_NANDFLASH) {
+       if (mtd->type != MTD_NANDFLASH && mtd->type != MTD_MLCNANDFLASH) {
                yaffs_trace(YAFFS_TRACE_ALWAYS,
                        "MTD device is not NAND it's type %d",
                        mtd->type);