From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Alan Cox <alan@linux.intel.com>,
linux-serial@vger.kernel.org
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>,
linux-kernel@vger.kernel.org
Subject: [PATCH 12/12] serial_core: Remove call to driver-specific TIO[GS]RS485]
Date: Wed, 8 Oct 2014 21:57:38 +0200 [thread overview]
Message-ID: <1412798258-23655-13-git-send-email-ricardo.ribalda@gmail.com> (raw)
In-Reply-To: <1412798258-23655-1-git-send-email-ricardo.ribalda@gmail.com>
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.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
drivers/tty/serial/serial_core.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 6015fd2..b59c925 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1154,9 +1154,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;
@@ -1250,7 +1247,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;
@@ -1258,15 +1260,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)
--
2.1.1
prev parent reply other threads:[~2014-10-08 19:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1412798258-23655-1-git-send-email-ricardo.ribalda@gmail.com>
2014-10-08 19:57 ` [PATCH 01/12] serial/max310x: Remove obsolete #ifset TIOC[SG]RS485 Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 02/12] serial/sc16is7xx: " Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 03/12] serial_core: Handle TIOC[GS]RS485 ioctls Ricardo Ribalda Delgado
2014-10-08 20:11 ` Alan Cox
2014-10-08 20:43 ` Ricardo Ribalda Delgado
2014-10-08 23:29 ` Alan Cox
2014-10-09 8:07 ` Ricardo Ribalda Delgado
2014-10-09 14:16 ` Alan Cox
2014-11-05 19:37 ` Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 04/12] serial/8250: Copy RS485 fields to serial_core Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 05/12] 8250/fintek: Use rs485 handler from serial_core Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 06/12] serial/8250: Remove obsolete handling of rs485 ioctls Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 07/12] serial/sc16is7xx: Use the rs485 functions on serial_core Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 08/12] serial/mcf: " Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 09/12] serial/atmel: " Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 10/12] serial/omap: " Ricardo Ribalda Delgado
2014-10-08 19:57 ` [PATCH 11/12] drivers/max310: " Ricardo Ribalda Delgado
2014-10-08 19:57 ` Ricardo Ribalda Delgado [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1412798258-23655-13-git-send-email-ricardo.ribalda@gmail.com \
--to=ricardo.ribalda@gmail.com \
--cc=alan@linux.intel.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®