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.
This commit is contained in:
YAMAMOTO Takashi 2021-03-18 13:37:39 +09:00 committed by Xiang Xiao
parent a813f79c41
commit 37300a43a5
1 changed files with 2 additions and 2 deletions

View File

@ -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))