diff options
author | Alan Cox <alan@linux.intel.com> | 2010-09-16 13:21:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:20:04 -0400 |
commit | 0bca1b913affbd7e2fdaffee62a499659a466eb5 (patch) | |
tree | a7e1c20146790345c0cdcadb31b4ff908d1632c2 /drivers/usb/serial/io_ti.c | |
parent | d281da7ff6f70efca0553c288bb883e8605b3862 (diff) |
tty: Convert the USB drivers to the new icount interface
Simple pasting job using the new ops function. Also fix a couple of devices
directly returning the internal struct (which happens at this point to match
for the fields that matter but isn't correct or futureproof)
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/io_ti.c')
-rw-r--r-- | drivers/usb/serial/io_ti.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index a7cfc5952937..4dad27a0f22a 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -2510,6 +2510,27 @@ static int edge_tiocmget(struct tty_struct *tty, struct file *file) | |||
2510 | return result; | 2510 | return result; |
2511 | } | 2511 | } |
2512 | 2512 | ||
2513 | static int edge_get_icount(struct tty_struct *tty, | ||
2514 | struct serial_icounter_struct *icount) | ||
2515 | { | ||
2516 | struct usb_serial_port *port = tty->driver_data; | ||
2517 | struct edgeport_port *edge_port = usb_get_serial_port_data(port); | ||
2518 | struct async_icount *ic = &edge_port->icount; | ||
2519 | |||
2520 | icount->cts = ic->cts; | ||
2521 | icount->dsr = ic->dsr; | ||
2522 | icount->rng = ic->rng; | ||
2523 | icount->dcd = ic->dcd; | ||
2524 | icount->tx = ic->tx; | ||
2525 | icount->rx = ic->rx; | ||
2526 | icount->frame = ic->frame; | ||
2527 | icount->parity = ic->parity; | ||
2528 | icount->overrun = ic->overrun; | ||
2529 | icount->brk = ic->brk; | ||
2530 | icount->buf_overrun = ic->buf_overrun; | ||
2531 | return 0; | ||
2532 | } | ||
2533 | |||
2513 | static int get_serial_info(struct edgeport_port *edge_port, | 2534 | static int get_serial_info(struct edgeport_port *edge_port, |
2514 | struct serial_struct __user *retinfo) | 2535 | struct serial_struct __user *retinfo) |
2515 | { | 2536 | { |
@@ -2572,13 +2593,6 @@ static int edge_ioctl(struct tty_struct *tty, struct file *file, | |||
2572 | } | 2593 | } |
2573 | /* not reached */ | 2594 | /* not reached */ |
2574 | break; | 2595 | break; |
2575 | case TIOCGICOUNT: | ||
2576 | dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, | ||
2577 | port->number, edge_port->icount.rx, edge_port->icount.tx); | ||
2578 | if (copy_to_user((void __user *)arg, &edge_port->icount, | ||
2579 | sizeof(edge_port->icount))) | ||
2580 | return -EFAULT; | ||
2581 | return 0; | ||
2582 | } | 2596 | } |
2583 | return -ENOIOCTLCMD; | 2597 | return -ENOIOCTLCMD; |
2584 | } | 2598 | } |
@@ -2758,6 +2772,7 @@ static struct usb_serial_driver edgeport_1port_device = { | |||
2758 | .set_termios = edge_set_termios, | 2772 | .set_termios = edge_set_termios, |
2759 | .tiocmget = edge_tiocmget, | 2773 | .tiocmget = edge_tiocmget, |
2760 | .tiocmset = edge_tiocmset, | 2774 | .tiocmset = edge_tiocmset, |
2775 | .get_icount = edge_get_icount, | ||
2761 | .write = edge_write, | 2776 | .write = edge_write, |
2762 | .write_room = edge_write_room, | 2777 | .write_room = edge_write_room, |
2763 | .chars_in_buffer = edge_chars_in_buffer, | 2778 | .chars_in_buffer = edge_chars_in_buffer, |