mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
drivers/mtd/mtd_cfi: Add MTDIOC_ERASESTATE
We need to give a default erase value when we register cfi flash for mtd devices
he pseudo-code is as follows:
register_cfi_driver(xxx)
find_mtddriver("xxx", &inode);
mtdconfig_register(inode->u.i_mtd);
https://github.com/Zhangshoukui/nuttx/blob/master/drivers/mtd/mtd_config.c#L1775C28-L1775C45
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
This commit is contained in:
@@ -235,6 +235,13 @@ static int cfi_mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_ERASESTATE:
|
||||
{
|
||||
FAR uint8_t *result = (FAR uint8_t *)arg;
|
||||
*result = 0xff;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user