From 5a51d3b23fe08190060991432c82f498a67fa637 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 11 Dec 2024 22:09:42 +0800 Subject: [PATCH] drivers/bch: Drivers may not support command BIOC_FLUSH Calling `bchlib_flushsector()` maybe enough on some devices. Signed-off-by: wangjianyu3 --- drivers/bch/bchdev_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c index 726932c193..7032908a5b 100644 --- a/drivers/bch/bchdev_driver.c +++ b/drivers/bch/bchdev_driver.c @@ -459,6 +459,13 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg) if (bchinode->u.i_bops->ioctl != NULL) { ret = bchinode->u.i_bops->ioctl(bchinode, cmd, arg); + + /* Drivers may not support command BIOC_FLUSH */ + + if (ret == -ENOTTY && cmd == BIOC_FLUSH) + { + ret = 0; + } } } break;