[Yaffs] Better support for MLC NAND

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Andre Renaud
Date:  
To: yaffs
Subject: [Yaffs] Better support for MLC NAND
Hi,
We've got an MLC NAND device, and remounting the yaffs filesystem as
readonly was failing.
mtd_type_is_nand was introduced in 2013 to make this a bit more robust, so
this patch moves YAFFS over to using it.

diff --git a/yaffs_mtdif_multi.c b/yaffs_mtdif_multi.c
index 5b0e4fe..a471601 100644
--- a/yaffs_mtdif_multi.c
+++ b/yaffs_mtdif_multi.c
@@ -258,7 +258,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_is_nand(mtd)) {
yaffs_trace(YAFFS_TRACE_ALWAYS,
"yaffs: MTD device is not NAND it's type %d",
mtd->type);
diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c
index de3dd75..5b6f254 100644
--- a/yaffs_vfs_multi.c
+++ b/yaffs_vfs_multi.c
@@ -2687,7 +2687,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_is_nand(mtd)) {
yaffs_trace(YAFFS_TRACE_ALWAYS,
"MTD device is not NAND it's type %d",
mtd->type);
diff --git a/yaffs_vfs_single.c b/yaffs_vfs_single.c
index 0ac24bc..091f3a9 100644
--- a/yaffs_vfs_single.c
+++ b/yaffs_vfs_single.c
@@ -1968,7 +1968,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_is_nand(mtd)) {
yaffs_trace(YAFFS_TRACE_ALWAYS,
"MTD device is not NAND it's type %d",
mtd->type);
@@ -2079,7 +2079,7 @@ static struct super_block
*yaffs_internal_read_super(int yaffs_version,
return NULL;
}
/* Check it's NAND */
- if (mtd->type != MTD_NANDFLASH) {
+ if (!mtd_type_is_nand(mtd)) {
yaffs_trace(YAFFS_TRACE_ALWAYS,
"MTD device is not NAND it's type %d",
mtd->type);