Merge ../linux-2.6-watchdog-mm
[pandora-kernel.git] / drivers / usb / serial / cypress_m8.c
index e1173c1..6bc1f40 100644 (file)
@@ -143,7 +143,7 @@ struct cypress_private {
        wait_queue_head_t delta_msr_wait;  /* used for TIOCMIWAIT */
        char prev_status, diff_status;     /* used for TIOCMIWAIT */
        /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */
-       struct termios tmp_termios;        /* stores the old termios settings */
+       struct ktermios tmp_termios;       /* stores the old termios settings */
 };
 
 /* write buffer structure */
@@ -165,15 +165,15 @@ static int  cypress_write         (struct usb_serial_port *port, const unsigned char *b
 static void cypress_send               (struct usb_serial_port *port);
 static int  cypress_write_room         (struct usb_serial_port *port);
 static int  cypress_ioctl              (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
-static void cypress_set_termios                (struct usb_serial_port *port, struct termios * old);
+static void cypress_set_termios                (struct usb_serial_port *port, struct ktermios * old);
 static int  cypress_tiocmget           (struct usb_serial_port *port, struct file *file);
 static int  cypress_tiocmset           (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
 static int  cypress_chars_in_buffer    (struct usb_serial_port *port);
 static void cypress_throttle           (struct usb_serial_port *port);
 static void cypress_unthrottle         (struct usb_serial_port *port);
 static void cypress_set_dead           (struct usb_serial_port *port);
-static void cypress_read_int_callback  (struct urb *urb, struct pt_regs *regs);
-static void cypress_write_int_callback (struct urb *urb, struct pt_regs *regs);
+static void cypress_read_int_callback  (struct urb *urb);
+static void cypress_write_int_callback (struct urb *urb);
 /* baud helper functions */
 static int      mask_to_rate           (unsigned mask);
 static unsigned  rate_to_mask          (int rate);
@@ -949,28 +949,13 @@ static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsi
 
        switch (cmd) {
                case TIOCGSERIAL:
-                       if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct termios))) {
+                       if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct ktermios))) {
                                return -EFAULT;
                        }
                        return (0);
                        break;
                case TIOCSSERIAL:
-                       if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct termios))) {
-                               return -EFAULT;
-                       }
-                       /* here we need to call cypress_set_termios to invoke the new settings */
-                       cypress_set_termios(port, &priv->tmp_termios);
-                       return (0);
-                       break;
-               /* these are called when setting baud rate from gpsd */
-               case TCGETS:
-                       if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct termios))) {
-                               return -EFAULT;
-                       }
-                       return (0);
-                       break;
-               case TCSETS:
-                       if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct termios))) {
+                       if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct ktermios))) {
                                return -EFAULT;
                        }
                        /* here we need to call cypress_set_termios to invoke the new settings */
@@ -1019,7 +1004,7 @@ static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsi
 
 
 static void cypress_set_termios (struct usb_serial_port *port,
-               struct termios *old_termios)
+               struct ktermios *old_termios)
 {
        struct cypress_private *priv = usb_get_serial_port_data(port);
        struct tty_struct *tty;
@@ -1275,7 +1260,7 @@ static void cypress_unthrottle (struct usb_serial_port *port)
 }
 
 
-static void cypress_read_int_callback(struct urb *urb, struct pt_regs *regs)
+static void cypress_read_int_callback(struct urb *urb)
 {
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        struct cypress_private *priv = usb_get_serial_port_data(port);
@@ -1426,7 +1411,7 @@ continue_read:
 } /* cypress_read_int_callback */
 
 
-static void cypress_write_int_callback(struct urb *urb, struct pt_regs *regs)
+static void cypress_write_int_callback(struct urb *urb)
 {
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        struct cypress_private *priv = usb_get_serial_port_data(port);
@@ -1493,7 +1478,7 @@ static struct cypress_buf *cypress_buf_alloc(unsigned int size)
        if (size == 0)
                return NULL;
 
-       cb = (struct cypress_buf *)kmalloc(sizeof(struct cypress_buf), GFP_KERNEL);
+       cb = kmalloc(sizeof(struct cypress_buf), GFP_KERNEL);
        if (cb == NULL)
                return NULL;
 
@@ -1684,15 +1669,14 @@ static int __init cypress_init(void)
 
        info(DRIVER_DESC " " DRIVER_VERSION);
        return 0;
+
 failed_usb_register:
-       usb_deregister(&cypress_driver);
-failed_ca42v2_register:
        usb_serial_deregister(&cypress_ca42v2_device);
-failed_hidcom_register:
+failed_ca42v2_register:
        usb_serial_deregister(&cypress_hidcom_device);
-failed_em_register:
+failed_hidcom_register:
        usb_serial_deregister(&cypress_earthmate_device);
-
+failed_em_register:
        return retval;
 }