mtd: Replace MTDIOC_PARTINFO with BIOC_PARTINFO

to simplify flt and partion layer implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-08-11 14:10:16 +08:00 committed by Alan Carvalho de Assis
parent 1023918d37
commit f4addbd640
3 changed files with 7 additions and 13 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 */