diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2014-11-06 03:22:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-06 18:00:20 -0500 |
commit | a9c20a9cf3190a517b88d8e08d93157256f97673 (patch) | |
tree | a12beeb5038478c7880d92b20d79ca1103fcf1dd | |
parent | c267d679cfd9699b9349fd714f63f6b4ee59dda2 (diff) |
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>
-rw-r--r-- | drivers/tty/serial/serial_core.c | 17 |
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, | |||
1155 | static int uart_get_rs485_config(struct uart_port *port, | 1155 | static int uart_get_rs485_config(struct uart_port *port, |
1156 | struct serial_rs485 __user *rs485) | 1156 | struct serial_rs485 __user *rs485) |
1157 | { | 1157 | { |
1158 | if (!port->rs485_config) | ||
1159 | return -ENOIOCTLCMD; | ||
1160 | |||
1161 | if (copy_to_user(rs485, &port->rs485, sizeof(port->rs485))) | 1158 | if (copy_to_user(rs485, &port->rs485, sizeof(port->rs485))) |
1162 | return -EFAULT; | 1159 | return -EFAULT; |
1163 | return 0; | 1160 | return 0; |
@@ -1255,7 +1252,12 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd, | |||
1255 | * All these rely on hardware being present and need to be | 1252 | * All these rely on hardware being present and need to be |
1256 | * protected against the tty being hung up. | 1253 | * protected against the tty being hung up. |
1257 | */ | 1254 | */ |
1255 | |||
1258 | switch (cmd) { | 1256 | switch (cmd) { |
1257 | case TIOCSERGETLSR: /* Get line status register */ | ||
1258 | ret = uart_get_lsr_info(tty, state, uarg); | ||
1259 | break; | ||
1260 | |||
1259 | case TIOCGRS485: | 1261 | case TIOCGRS485: |
1260 | ret = uart_get_rs485_config(state->uart_port, uarg); | 1262 | ret = uart_get_rs485_config(state->uart_port, uarg); |
1261 | break; | 1263 | break; |
@@ -1263,15 +1265,6 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd, | |||
1263 | case TIOCSRS485: | 1265 | case TIOCSRS485: |
1264 | ret = uart_set_rs485_config(state->uart_port, uarg); | 1266 | ret = uart_set_rs485_config(state->uart_port, uarg); |
1265 | break; | 1267 | break; |
1266 | } | ||
1267 | if (ret != -ENOIOCTLCMD) | ||
1268 | goto out; | ||
1269 | |||
1270 | switch (cmd) { | ||
1271 | case TIOCSERGETLSR: /* Get line status register */ | ||
1272 | ret = uart_get_lsr_info(tty, state, uarg); | ||
1273 | break; | ||
1274 | |||
1275 | default: { | 1268 | default: { |
1276 | struct uart_port *uport = state->uart_port; | 1269 | struct uart_port *uport = state->uart_port; |
1277 | if (uport->ops->ioctl) | 1270 | if (uport->ops->ioctl) |