mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
mtdconfig: lomtdconfig device change to depends on !MTD_CONFIG_NONE
The structure of mtd_config in Kconfig has changed. Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
#include <nuttx/fs/ioctl.h>
|
#include <nuttx/fs/ioctl.h>
|
||||||
#include <nuttx/fs/loopmtd.h>
|
#include <nuttx/fs/loopmtd.h>
|
||||||
#include <nuttx/mtd/mtd.h>
|
#include <nuttx/mtd/mtd.h>
|
||||||
#ifdef CONFIG_MTD_CONFIG
|
#ifndef CONFIG_MTD_CONFIG_NONE
|
||||||
# include <nuttx/mtd/configdata.h>
|
# include <nuttx/mtd/configdata.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -554,7 +554,7 @@ static int filemtd_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_LOOP
|
#ifdef CONFIG_MTD_LOOP
|
||||||
# ifdef CONFIG_MTD_CONFIG
|
# ifndef CONFIG_MTD_CONFIG_NONE
|
||||||
static int mtd_loop_setup(FAR const char *devname, FAR const char *filename,
|
static int mtd_loop_setup(FAR const char *devname, FAR const char *filename,
|
||||||
int sectsize, int erasesize, off_t offset,
|
int sectsize, int erasesize, off_t offset,
|
||||||
int configdata)
|
int configdata)
|
||||||
@@ -572,7 +572,7 @@ static int mtd_loop_setup(FAR const char *devname, FAR const char *filename,
|
|||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef CONFIG_MTD_CONFIG
|
# ifndef CONFIG_MTD_CONFIG_NONE
|
||||||
if (configdata)
|
if (configdata)
|
||||||
{
|
{
|
||||||
if (configdata == 2)
|
if (configdata == 2)
|
||||||
@@ -647,7 +647,7 @@ static int mtd_loop_teardown(FAR const char *devname)
|
|||||||
|
|
||||||
filemtd_teardown(&dev->mtd);
|
filemtd_teardown(&dev->mtd);
|
||||||
|
|
||||||
# ifdef CONFIG_MTD_CONFIG
|
# ifndef CONFIG_MTD_CONFIG_NONE
|
||||||
if (inode->i_private)
|
if (inode->i_private)
|
||||||
{
|
{
|
||||||
mtdconfig_unregister_by_path(devname);
|
mtdconfig_unregister_by_path(devname);
|
||||||
@@ -715,7 +715,7 @@ static int mtd_loop_ioctl(FAR struct file *filep, int cmd,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# ifdef CONFIG_MTD_CONFIG
|
# ifndef CONFIG_MTD_CONFIG_NONE
|
||||||
ret = mtd_loop_setup(setup->devname, setup->filename,
|
ret = mtd_loop_setup(setup->devname, setup->filename,
|
||||||
setup->sectsize, setup->erasesize,
|
setup->sectsize, setup->erasesize,
|
||||||
setup->offset, setup->configdata);
|
setup->offset, setup->configdata);
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ struct mtd_losetup_s
|
|||||||
size_t erasesize; /* The erase size to use on the file */
|
size_t erasesize; /* The erase size to use on the file */
|
||||||
size_t sectsize; /* The sector / page size of the file */
|
size_t sectsize; /* The sector / page size of the file */
|
||||||
off_t offset; /* An offset that may be applied to the device */
|
off_t offset; /* An offset that may be applied to the device */
|
||||||
# ifdef CONFIG_MTD_CONFIG
|
# ifndef CONFIG_MTD_CONFIG_NONE
|
||||||
int configdata; /* 1: register mtdconfig device, 2: erase before register */
|
int configdata; /* 1: register mtdconfig device, 2: erase before register */
|
||||||
# endif
|
# endif
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user