lkml.org 
[lkml]   [2018]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/50] mos7720: bury dead TIOCM... in ->ioctl()
    Date
    From: Al Viro <viro@zeniv.linux.org.uk>

    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>
    ---
    drivers/usb/serial/mos7720.c | 52 --------------------------------------------
    1 file changed, 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,
    --
    2.11.0
    \
     
     \ /
      Last update: 2018-09-13 04:45    [W:3.491 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site