[PATCH] UBI: block: Use ENOSYS as return value when CONFIG_UBIBLOCK=n

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Tue Mar 4 05:57:43 EST 2014


In order to have a way of distinguishing an invalid ioctl from a
not supported (but otherwise valid) ioctl, this commit changes the
return value of the ioctl stubs from ENOTTY to ENOSYS.

This will be useful to report more accurate error messages from
userspace tools.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
---
 drivers/mtd/ubi/ubi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index e76ff98..a8118f2 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -873,8 +873,8 @@ int ubiblock_del(struct ubi_volume_info *vi);
 #else
 static inline int ubiblock_init(void) { return 0; }
 static inline void ubiblock_exit(void) {}
-static inline int ubiblock_add(struct ubi_volume_info *vi) { return -ENOTTY; }
-static inline int ubiblock_del(struct ubi_volume_info *vi) { return -ENOTTY; }
+static inline int ubiblock_add(struct ubi_volume_info *vi) { return -ENOSYS; }
+static inline int ubiblock_del(struct ubi_volume_info *vi) { return -ENOSYS; }
 #endif
 
 
-- 
1.8.1.5




More information about the linux-mtd mailing list