From e33a38c931221c8d97b1f8e65b864ca0982d798d Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Mon, 16 Dec 2024 12:18:18 +0200 Subject: [PATCH] platforms/nuttx/src/px4/common/px4_24xxxx_mtd.c: Add BIOC_FLUSH There is nothing left to do after bchlib, but this needs to return OK in order for "fsync" not to fail. Signed-off-by: Jukka Laitinen --- platforms/nuttx/src/px4/common/px4_24xxxx_mtd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platforms/nuttx/src/px4/common/px4_24xxxx_mtd.c b/platforms/nuttx/src/px4/common/px4_24xxxx_mtd.c index 63d76f3ec9c8..1cc2cae24218 100644 --- a/platforms/nuttx/src/px4/common/px4_24xxxx_mtd.c +++ b/platforms/nuttx/src/px4/common/px4_24xxxx_mtd.c @@ -551,6 +551,11 @@ static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) ret = at24c_eraseall(priv); break; + case BIOC_FLUSH: + /* bchlib has already taken care of writing the pages */ + ret = OK; + break; + default: ret = -ENOTTY; /* Bad command */ break;