]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/usb/serial/io_edgeport.c
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[net-next-2.6.git] / drivers / usb / serial / io_edgeport.c
index 76e6fb3aab7a475c0c64f708298be4c9b03b36a0..cd769ef24f8a04b2bfb7d44ee852a22536f11a98 100644 (file)
@@ -222,6 +222,8 @@ static void edge_break(struct tty_struct *tty, int break_state);
 static int  edge_tiocmget(struct tty_struct *tty, struct file *file);
 static int  edge_tiocmset(struct tty_struct *tty, struct file *file,
                                        unsigned int set, unsigned int clear);
+static int  edge_get_icount(struct tty_struct *tty,
+                               struct serial_icounter_struct *icount);
 static int  edge_startup(struct usb_serial *serial);
 static void edge_disconnect(struct usb_serial *serial);
 static void edge_release(struct usb_serial *serial);
@@ -1465,8 +1467,6 @@ static void edge_throttle(struct tty_struct *tty)
                if (status != 0)
                        return;
        }
-
-       return;
 }
 
 
@@ -1624,6 +1624,31 @@ static int edge_tiocmget(struct tty_struct *tty, struct file *file)
        return result;
 }
 
+static int edge_get_icount(struct tty_struct *tty,
+                               struct serial_icounter_struct *icount)
+{
+       struct usb_serial_port *port = tty->driver_data;
+       struct edgeport_port *edge_port = usb_get_serial_port_data(port);
+       struct async_icount cnow;
+       cnow = edge_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;
+
+       dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d",
+                       __func__,  port->number, icount->rx, icount->tx);
+       return 0;
+}
+
 static int get_serial_info(struct edgeport_port *edge_port,
                                struct serial_struct __user *retinfo)
 {
@@ -1650,7 +1675,6 @@ static int get_serial_info(struct edgeport_port *edge_port,
 }
 
 
-
 /*****************************************************************************
  * SerialIoctl
  *     this function handles any ioctl calls to the driver
@@ -1663,7 +1687,6 @@ static int edge_ioctl(struct tty_struct *tty, struct file *file,
        struct edgeport_port *edge_port = usb_get_serial_port_data(port);
        struct async_icount cnow;
        struct async_icount cprev;
-       struct serial_icounter_struct icount;
 
        dbg("%s - port %d, cmd = 0x%x", __func__, port->number, cmd);
 
@@ -1702,26 +1725,6 @@ static int edge_ioctl(struct tty_struct *tty, struct file *file,
                /* NOTREACHED */
                break;
 
-       case TIOCGICOUNT:
-               cnow = edge_port->icount;
-               memset(&icount, 0, sizeof(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;
-
-               dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d",
-                               __func__,  port->number, icount.rx, icount.tx);
-               if (copy_to_user((void __user *)arg, &icount, sizeof(icount)))
-                       return -EFAULT;
-               return 0;
        }
        return -ENOIOCTLCMD;
 }
@@ -1770,8 +1773,6 @@ static void edge_break(struct tty_struct *tty, int break_state)
                        dbg("%s - error sending break set/clear command.",
                                __func__);
        }
-
-       return;
 }
 
 
@@ -2042,7 +2043,6 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial,
                dbg("%s - Unrecognized IOSP status code %u", __func__, code);
                break;
        }
-       return;
 }
 
 
@@ -2095,8 +2095,6 @@ static void handle_new_msr(struct edgeport_port *edge_port, __u8 newMsr)
 
        /* Save the new modem status */
        edge_port->shadowMSR = newMsr & 0xf0;
-
-       return;
 }
 
 
@@ -2143,8 +2141,6 @@ static void handle_new_lsr(struct edgeport_port *edge_port, __u8 lsrData,
                icount->parity++;
        if (newLsr & LSR_FRM_ERR)
                icount->frame++;
-
-       return;
 }
 
 
@@ -2720,7 +2716,6 @@ static void change_port_settings(struct tty_struct *tty,
                baud = tty_termios_baud_rate(old_termios);
                tty_encode_baud_rate(tty, baud, baud);
        }
-       return;
 }
 
 
@@ -2922,7 +2917,6 @@ static void load_application_firmware(struct edgeport_serial *edge_serial)
                                    0x40, 0x4000, 0x0001, NULL, 0, 3000);
 
        release_firmware(fw);
-       return;
 }