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 7c01461..d15c660 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 864a5dc..73dcc3c 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);