summary refs log tree commit diff
path: root/drivers/tty
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-09-12 07:46:51 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-10-13 00:50:43 -0400
commit930236a30897532653a61ed22ae7eca13154accd (patch)
tree966cf1e274b9c6c5bb99c8790e94f2ab69fffc31 /drivers/tty
parent15cc7bad48977582a35c06f5afa0cfc1d4975bd9 (diff)
downloadlinux-930236a30897532653a61ed22ae7eca13154accd.tar.gz
complete ->[sg]et_serial() switchover
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/tty_io.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index b96bfd051d59..15d60ba13187 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2474,7 +2474,7 @@ static int tty_tiocsserial(struct tty_struct *tty, struct serial_struct __user *
 		pr_warn("%s: '%s' is using deprecated serial flags (with no effect): %.8x\n",
 			__func__, get_task_comm(comm, current), flags);
 	if (!tty->ops->set_serial)
-		return -ENOIOCTLCMD;
+		return -ENOTTY;
 	return tty->ops->set_serial(tty, &v);
 }
 
@@ -2485,7 +2485,7 @@ static int tty_tiocgserial(struct tty_struct *tty, struct serial_struct __user *
 
 	memset(&v, 0, sizeof(struct serial_struct));
 	if (!tty->ops->get_serial)
-		return -ENOIOCTLCMD;
+		return -ENOTTY;
 	err = tty->ops->get_serial(tty, &v);
 	if (!err && copy_to_user(ss, &v, sizeof(struct serial_struct)))
 		err = -EFAULT;
@@ -2621,15 +2621,9 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		}
 		break;
 	case TIOCSSERIAL:
-		retval = tty_tiocsserial(tty, p);
-		if (retval != -ENOIOCTLCMD)
-			return retval;
-		break;
+		return tty_tiocsserial(tty, p);
 	case TIOCGSERIAL:
-		retval = tty_tiocgserial(tty, p);
-		if (retval != -ENOIOCTLCMD)
-			return retval;
-		break;
+		return tty_tiocgserial(tty, p);
 	case TIOCGPTPEER:
 		/* Special because the struct file is needed */
 		return ptm_open_peer(file, tty, (int)arg);