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 f4addbd640a0619458d05fa1c8ca840cbca044f3
Author: Xiang Xiao <[email protected]>
AuthorDate: Wed Aug 11 14:10:16 2021 +0800

    mtd: Replace MTDIOC_PARTINFO with BIOC_PARTINFO
    
    to simplify flt and partion layer implementation
    
    Signed-off-by: Xiang Xiao <[email protected]>
---
 drivers/mtd/ftl.c           |  6 ------
 drivers/mtd/mtd_partition.c |  2 +-
 include/nuttx/mtd/mtd.h     | 12 ++++++------
 3 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 39cb2d1..2823487 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -540,12 +540,6 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, 
unsigned long arg)
 
       cmd = MTDIOC_FLUSH;
     }
-  else if (cmd == BIOC_PARTINFO)
-    {
-      /* Change the BIOC_PARTINFO command to the MTDIOC_PARTINFO command. */
-
-      cmd = MTDIOC_PARTINFO;
-    }
 
   /* No other block driver ioctl commands are not recognized by this
    * driver.  Other possible MTD driver ioctl commands are passed through
diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c
index d0d5994..b71722d 100644
--- a/drivers/mtd/mtd_partition.c
+++ b/drivers/mtd/mtd_partition.c
@@ -414,7 +414,7 @@ static int part_ioctl(FAR struct mtd_dev_s *dev, int cmd, 
unsigned long arg)
         }
         break;
 
-      case MTDIOC_PARTINFO:
+      case BIOC_PARTINFO:
         {
           FAR struct partition_info_s *info =
             (FAR struct partition_info_s *)arg;
diff --git a/include/nuttx/mtd/mtd.h b/include/nuttx/mtd/mtd.h
index 2b95bd1..2a87d5d 100644
--- a/include/nuttx/mtd/mtd.h
+++ b/include/nuttx/mtd/mtd.h
@@ -40,6 +40,12 @@
 
 /* Ioctl commands */
 
+/* Note, the following ioctl existed in the past and was removed:
+ * #define MTDIOC_PARTINFO   _MTDIOC(0x000b)
+ * try to avoid adding a new ioctl with the same ioctl number and
+ * replace with BIOC_PARTINFO instead.
+ */
+
 #define MTDIOC_GEOMETRY   _MTDIOC(0x0001) /* IN:  Pointer to write-able struct
                                            *      mtd_geometry_s in which to 
receive
                                            *      receive geometry data (see 
mtd.h)
@@ -74,12 +80,6 @@
 #define MTDIOC_ERASESTATE _MTDIOC(0x000a) /* IN:  Pointer to uint8_t
                                            * OUT: Byte value that represents 
the
                                            *      erased state of the MTD cell 
*/
-#define MTDIOC_PARTINFO   _MTDIOC(0x000b) /* IN:  Pointer to writable struct
-                                           *      partition_info_s in which to
-                                           *      receive partition 
information data
-                                           * OUT: Partition information 
structure
-                                           *      populated with data from the 
MTD
-                                           *      partition */
 
 /* Macros to hide implementation */
 

Reply via email to