Skip to content

Commit

Permalink
drivers/bch: Drivers may not support command BIOC_FLUSH
Browse files Browse the repository at this point in the history
Calling `bchlib_flushsector()` maybe enough on some devices.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
  • Loading branch information
JianyuWang0623 committed Dec 26, 2024
1 parent 1714571 commit a6261e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/bch/bchdev_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,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;
Expand Down

0 comments on commit a6261e9

Please sign in to comment.