summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/serial_core.c
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>2014-11-06 11:22:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-07 02:00:20 +0300
commita9c20a9cf3190a517b88d8e08d93157256f97673 (patch)
treea12beeb5038478c7880d92b20d79ca1103fcf1dd /drivers/tty/serial/serial_core.c
parentc267d679cfd9699b9349fd714f63f6b4ee59dda2 (diff)
downloadlinux-a9c20a9cf3190a517b88d8e08d93157256f97673.tar.xz
serial_core: Remove call to driver-specific TIO[GS]RS485]
Once there is no more handlers for TIOC[GS]RS485 there is no need to call the driver specific ioctl when the generic implementation is missing. Reviewed-by: Alan Cox <alan@linux.intel.com> Cc: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/serial_core.c')
-rw-r--r--drivers/tty/serial/serial_core.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index ab4db1dcc474..99fcdba0e3e9 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1155,9 +1155,6 @@ static int uart_get_icount(struct tty_struct *tty,
static int uart_get_rs485_config(struct uart_port *port,
struct serial_rs485 __user *rs485)
{
- if (!port->rs485_config)
- return -ENOIOCTLCMD;
-
if (copy_to_user(rs485, &port->rs485, sizeof(port->rs485)))
return -EFAULT;
return 0;
@@ -1255,7 +1252,12 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd,
* All these rely on hardware being present and need to be
* protected against the tty being hung up.
*/
+
switch (cmd) {
+ case TIOCSERGETLSR: /* Get line status register */
+ ret = uart_get_lsr_info(tty, state, uarg);
+ break;
+
case TIOCGRS485:
ret = uart_get_rs485_config(state->uart_port, uarg);
break;
@@ -1263,15 +1265,6 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd,
case TIOCSRS485:
ret = uart_set_rs485_config(state->uart_port, uarg);
break;
- }
- if (ret != -ENOIOCTLCMD)
- goto out;
-
- switch (cmd) {
- case TIOCSERGETLSR: /* Get line status register */
- ret = uart_get_lsr_info(tty, state, uarg);
- break;
-
default: {
struct uart_port *uport = state->uart_port;
if (uport->ops->ioctl)