mtd/nand: Implement MTDIOC_ERASESECTORS ioctl

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-05-01 02:23:52 +08:00 committed by Alin Jerpelea
parent 3fc882df9e
commit b4814811f5

View File

@ -798,6 +798,13 @@ static int nand_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
}
break;
case MTDIOC_ERASESECTORS:
{
FAR struct mtd_erase_s *erase = (FAR struct mtd_erase_s *)arg;
ret = nand_erase(dev, erase->startblock, erase->nblocks);
}
break;
default:
ret = -ENOTTY; /* Bad command */
break;