You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2021/08/12 11:01:37 UTC
[incubator-nuttx] 02/03: Revert "mtd: Add MTDIOC_FLUSH IOCTL like
MTDIOC_XIPBASE"
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 177e1ced3f8aababeedaf03031786e3b30db454f
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Aug 11 14:07:58 2021 +0800
Revert "mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE"
to simplify flt and partion layer implementation
This reverts commit 2e49e1bc5c6a316e407c430596013fa3a5c13f84.
---
drivers/mtd/ftl.c | 4 ----
fs/littlefs/lfs_vfs.c | 2 +-
include/nuttx/mtd/mtd.h | 6 ++----
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 2823487..664b9df 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -535,10 +535,6 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
#ifdef CONFIG_FTL_WRITEBUFFER
rwb_flush(&dev->rwb);
#endif
-
- /* Change the BIOC_FLUSH command to the MTDIOC_FLUSH command. */
-
- cmd = MTDIOC_FLUSH;
}
/* No other block driver ioctl commands are not recognized by this
diff --git a/fs/littlefs/lfs_vfs.c b/fs/littlefs/lfs_vfs.c
index eb77da0..abc6129 100644
--- a/fs/littlefs/lfs_vfs.c
+++ b/fs/littlefs/lfs_vfs.c
@@ -928,7 +928,7 @@ static int littlefs_sync_block(FAR const struct lfs_config *c)
if (INODE_IS_MTD(drv))
{
- ret = MTD_IOCTL(drv->u.i_mtd, MTDIOC_FLUSH, 0);
+ ret = MTD_IOCTL(drv->u.i_mtd, BIOC_FLUSH, 0);
}
else
{
diff --git a/include/nuttx/mtd/mtd.h b/include/nuttx/mtd/mtd.h
index 2a87d5d..fe4bf05 100644
--- a/include/nuttx/mtd/mtd.h
+++ b/include/nuttx/mtd/mtd.h
@@ -41,9 +41,10 @@
/* Ioctl commands */
/* Note, the following ioctl existed in the past and was removed:
+ * #define MTDIOC_FLUSH _MTDIOC(0x0009)
* #define MTDIOC_PARTINFO _MTDIOC(0x000b)
* try to avoid adding a new ioctl with the same ioctl number and
- * replace with BIOC_PARTINFO instead.
+ * replace with BIOC_FLUSH and BIOC_PARTINFO instead.
*/
#define MTDIOC_GEOMETRY _MTDIOC(0x0001) /* IN: Pointer to write-able struct
@@ -74,9 +75,6 @@
* OUT: None */
#define MTDIOC_ECCSTATUS _MTDIOC(0x0008) /* IN: Pointer to uint8_t
* OUT: ECC status */
-#define MTDIOC_FLUSH _MTDIOC(0x0009) /* IN: None
- * OUT: None (ioctl return value provides
- * success/failure indication). */
#define MTDIOC_ERASESTATE _MTDIOC(0x000a) /* IN: Pointer to uint8_t
* OUT: Byte value that represents the
* erased state of the MTD cell */