summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2021-04-07 11:52:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-22 10:57:29 +0200
commit4c88dc3b6101d029cd36a72f51f0d2c3cf389738 (patch)
tree7df9c05ee09e31a8792dd5c6de41e831e9a4bd55 /include
parent9c1fbf6d3ef2ad60292660ba3d0c48184ee3239a (diff)
downloadlinux-stable-4c88dc3b6101d029cd36a72f51f0d2c3cf389738.tar.gz
linux-stable-4c88dc3b6101d029cd36a72f51f0d2c3cf389738.tar.bz2
linux-stable-4c88dc3b6101d029cd36a72f51f0d2c3cf389738.zip
tty: fix return value for unsupported ioctls
[ Upstream commit 1b8b20868a6d64cfe8174a21b25b74367bdf0560 ] Drivers should return -ENOTTY ("Inappropriate I/O control operation") when an ioctl isn't supported, while -EINVAL is used for invalid arguments. Fix up the TIOCMGET, TIOCMSET and TIOCGICOUNT helpers which returned -EINVAL when a tty driver did not implement the corresponding operations. Note that the TIOCMGET and TIOCMSET helpers predate git and do not get a corresponding Fixes tag below. Fixes: d281da7ff6f7 ("tty: Make tiocgicount a handler") Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20210407095208.31838-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/tty_driver.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 31c2b5b166de..ebca9e4a2fed 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -236,7 +236,7 @@
*
* Called when the device receives a TIOCGICOUNT ioctl. Passed a kernel
* structure to complete. This method is optional and will only be called
- * if provided (otherwise EINVAL will be returned).
+ * if provided (otherwise ENOTTY will be returned).
*/
#include <linux/export.h>