diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c index f0c61a8137..6fbea4e8ec 100644 --- a/drivers/bch/bchdev_driver.c +++ b/drivers/bch/bchdev_driver.c @@ -420,14 +420,6 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } break; - case BIOC_FLUSH: - { - /* Flush any dirty pages remaining in the cache */ - - ret = bchlib_flushsector(bch, false); - } - break; - #ifdef CONFIG_BCH_ENCRYPTION /* This is a request to set the encryption key? */ @@ -439,9 +431,20 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; #endif - /* Otherwise, pass the IOCTL command on to the contained block - * driver. - */ + case BIOC_FLUSH: + { + /* Flush any dirty pages remaining in the cache */ + + ret = bchlib_flushsector(bch, false); + if (ret < 0) + { + break; + } + + /* Go through */ + } + + /* Pass the IOCTL command on to the contained block driver. */ default: {