diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-09-12 06:13:10 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-09-14 17:12:37 +0200 |
commit | 7eaec37e04616136915ad2207417beb29445fc35 (patch) | |
tree | 99cb08990f2983a9916520da200a6d114cb0edba /drivers/usb/serial/mos7720.c | |
parent | tty_ioctl(): drop FIONBIO handling (diff) | |
download | linux-7eaec37e04616136915ad2207417beb29445fc35.tar.xz linux-7eaec37e04616136915ad2207417beb29445fc35.zip |
mos7720: bury dead TIOCM... in ->ioctl()
These ioctls never reach driver's ->ioctl() - tty_ioctl() handles
them on its own. ->tiocm[gs]et() is what actually gets called,
and mos7720 provides those, with results equivalent to what the
unreachable code would be doing when called.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/usb/serial/mos7720.c')
-rw-r--r-- | drivers/usb/serial/mos7720.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 27109522fd8b..4c06357b3ef8 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c @@ -1786,51 +1786,6 @@ static int mos7720_tiocmset(struct tty_struct *tty, return 0; } -static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd, - unsigned int __user *value) -{ - unsigned int mcr; - unsigned int arg; - - struct usb_serial_port *port; - - if (mos7720_port == NULL) - return -1; - - port = (struct usb_serial_port *)mos7720_port->port; - mcr = mos7720_port->shadowMCR; - - if (copy_from_user(&arg, value, sizeof(int))) - return -EFAULT; - - switch (cmd) { - case TIOCMBIS: - if (arg & TIOCM_RTS) - mcr |= UART_MCR_RTS; - if (arg & TIOCM_DTR) - mcr |= UART_MCR_RTS; - if (arg & TIOCM_LOOP) - mcr |= UART_MCR_LOOP; - break; - - case TIOCMBIC: - if (arg & TIOCM_RTS) - mcr &= ~UART_MCR_RTS; - if (arg & TIOCM_DTR) - mcr &= ~UART_MCR_RTS; - if (arg & TIOCM_LOOP) - mcr &= ~UART_MCR_LOOP; - break; - - } - - mos7720_port->shadowMCR = mcr; - write_mos_reg(port->serial, port->port_number, MOS7720_MCR, - mos7720_port->shadowMCR); - - return 0; -} - static int get_serial_info(struct moschip_port *mos7720_port, struct serial_struct __user *retinfo) { @@ -1868,13 +1823,6 @@ static int mos7720_ioctl(struct tty_struct *tty, return get_lsr_info(tty, mos7720_port, (unsigned int __user *)arg); - /* FIXME: These should be using the mode methods */ - case TIOCMBIS: - case TIOCMBIC: - dev_dbg(&port->dev, "%s TIOCMSET/TIOCMBIC/TIOCMSET\n", __func__); - return set_modem_info(mos7720_port, cmd, - (unsigned int __user *)arg); - case TIOCGSERIAL: dev_dbg(&port->dev, "%s TIOCGSERIAL\n", __func__); return get_serial_info(mos7720_port, |