From 37300a43a58088d546e71f3d4d5a4273f6ccbf68 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 18 Mar 2021 13:37:39 +0900 Subject: [PATCH] esp32_part_ioctl: Return -ENOTTY for unknown commands It's traditional to use ENOTTY for this purpose. Littlefs seems to rely on this behavior for BIOC_FLUSH. Also, drop the log level. --- arch/xtensa/src/esp32/esp32_partition.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/xtensa/src/esp32/esp32_partition.c b/arch/xtensa/src/esp32/esp32_partition.c index 2f55647e96..107dcc06d4 100644 --- a/arch/xtensa/src/esp32/esp32_partition.c +++ b/arch/xtensa/src/esp32/esp32_partition.c @@ -497,8 +497,8 @@ static int esp32_part_ioctl(FAR struct mtd_dev_s *dev, int cmd, if (!_MTDIOCVALID(cmd)) { - ferr("ERROR: cmd=%d(%x) is error\n", cmd, cmd); - return -EINVAL; + finfo("INFO: cmd=%d(%x) is error\n", cmd, cmd); + return -ENOTTY; } switch (_IOC_NR(cmd))