diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-03-21 12:37:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 13:52:24 -0700 |
commit | 35711578044076d00d396cb6787d3cc593a4c35a (patch) | |
tree | c34e9522e8d32f9a99cbc63cf7f7109ac6e9ab56 /drivers/usb/serial/mos7720.c | |
parent | 128434ab5607c6bccf385765e94382cedd3d06fa (diff) | |
download | lwn-35711578044076d00d396cb6787d3cc593a4c35a.tar.gz lwn-35711578044076d00d396cb6787d3cc593a4c35a.zip |
USB: mos7720: remove broken get_icount and TIOCMIWAIT
Remove broken get_icount and TIOCMIWAIT support.
The driver has an icount structure but it is never been updated which
makes get_icount rather pointless and causes TIOCMIWAIT to always return
-EIO.
Note that the TIOCMIWAIT implementation has always been broken and would
not work even if icount support was added as it does not wait for the
modem status to change (does not use a work queue at all).
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/mos7720.c')
-rw-r--r-- | drivers/usb/serial/mos7720.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index e0ebec3b5d6a..d1e2bf30bff8 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c @@ -62,7 +62,6 @@ struct moschip_port { __u8 shadowMCR; /* last MCR value received */ __u8 shadowMSR; /* last MSR value received */ char open; - struct async_icount icount; struct usb_serial_port *port; /* loop back to the owner */ struct urb *write_urb_pool[NUM_URBS]; }; @@ -1075,9 +1074,6 @@ static int mos7720_open(struct tty_struct *tty, struct usb_serial_port *port) dev_err(&port->dev, "%s - Error %d submitting read urb\n", __func__, response); - /* initialize our icount structure */ - memset(&(mos7720_port->icount), 0x00, sizeof(mos7720_port->icount)); - /* initialize our port settings */ mos7720_port->shadowMCR = UART_MCR_OUT2; /* Must set to enable ints! */ @@ -1803,33 +1799,6 @@ static int mos7720_tiocmset(struct tty_struct *tty, return 0; } -static int mos7720_get_icount(struct tty_struct *tty, - struct serial_icounter_struct *icount) -{ - struct usb_serial_port *port = tty->driver_data; - struct moschip_port *mos7720_port; - struct async_icount cnow; - - mos7720_port = usb_get_serial_port_data(port); - cnow = mos7720_port->icount; - - icount->cts = cnow.cts; - icount->dsr = cnow.dsr; - icount->rng = cnow.rng; - icount->dcd = cnow.dcd; - icount->rx = cnow.rx; - icount->tx = cnow.tx; - icount->frame = cnow.frame; - icount->overrun = cnow.overrun; - icount->parity = cnow.parity; - icount->brk = cnow.brk; - icount->buf_overrun = cnow.buf_overrun; - - dev_dbg(&port->dev, "%s TIOCGICOUNT RX=%d, TX=%d\n", __func__, - icount->rx, icount->tx); - return 0; -} - static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd, unsigned int __user *value) { @@ -1905,8 +1874,6 @@ static int mos7720_ioctl(struct tty_struct *tty, { struct usb_serial_port *port = tty->driver_data; struct moschip_port *mos7720_port; - struct async_icount cnow; - struct async_icount cprev; mos7720_port = usb_get_serial_port_data(port); if (mos7720_port == NULL) @@ -1931,27 +1898,6 @@ static int mos7720_ioctl(struct tty_struct *tty, dev_dbg(&port->dev, "%s TIOCGSERIAL\n", __func__); return get_serial_info(mos7720_port, (struct serial_struct __user *)arg); - - case TIOCMIWAIT: - dev_dbg(&port->dev, "%s TIOCMIWAIT\n", __func__); - cprev = mos7720_port->icount; - while (1) { - if (signal_pending(current)) - return -ERESTARTSYS; - cnow = mos7720_port->icount; - if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && - cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) - return -EIO; /* no change => error */ - if (((arg & TIOCM_RNG) && (cnow.rng != cprev.rng)) || - ((arg & TIOCM_DSR) && (cnow.dsr != cprev.dsr)) || - ((arg & TIOCM_CD) && (cnow.dcd != cprev.dcd)) || - ((arg & TIOCM_CTS) && (cnow.cts != cprev.cts))) { - return 0; - } - cprev = cnow; - } - /* NOTREACHED */ - break; } return -ENOIOCTLCMD; @@ -2107,7 +2053,6 @@ static struct usb_serial_driver moschip7720_2port_driver = { .ioctl = mos7720_ioctl, .tiocmget = mos7720_tiocmget, .tiocmset = mos7720_tiocmset, - .get_icount = mos7720_get_icount, .set_termios = mos7720_set_termios, .write = mos7720_write, .write_room = mos7720_write_room, |