drivers/bch: Drivers may not support command BIOC_FLUSH

Calling `bchlib_flushsector()` maybe enough on some devices.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3 2024-12-11 22:09:42 +08:00 committed by Xiang Xiao
parent 1dcada4917
commit 5a51d3b23f

View file

@ -459,6 +459,13 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
if (bchinode->u.i_bops->ioctl != NULL) if (bchinode->u.i_bops->ioctl != NULL)
{ {
ret = bchinode->u.i_bops->ioctl(bchinode, cmd, arg); 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; break;