From 87d5a39f68b5e3eb8d9400b9ae2fbba3f369204d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 15 Mar 2021 11:29:34 +0900 Subject: [PATCH] find_blockdriver: Don't ferr() on MTDs It's the normal path when you open a MTD. ferr() is too strong. --- fs/driver/fs_findblockdriver.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fs/driver/fs_findblockdriver.c b/fs/driver/fs_findblockdriver.c index 4e87cf9e5c..c89b9400d3 100644 --- a/fs/driver/fs_findblockdriver.c +++ b/fs/driver/fs_findblockdriver.c @@ -94,7 +94,17 @@ int find_blockdriver(FAR const char *pathname, int mountflags, if (!INODE_IS_BLOCK(inode)) { - ferr("ERROR: %s is not a block driver\n", pathname); +#ifdef CONFIG_MTD + if (INODE_IS_MTD(inode)) + { + finfo("%s is a MTD\n", pathname); + } + else +#endif + { + ferr("ERROR: %s is not a block driver\n", pathname); + } + ret = -ENOTBLK; goto errout_with_inode; }