diff options
Diffstat (limited to 'drivers/usb/serial/cypress_m8.c')
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 093f303b3189..57b8e27285fc 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -143,7 +143,7 @@ struct cypress_private { | |||
143 | wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */ | 143 | wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */ |
144 | char prev_status, diff_status; /* used for TIOCMIWAIT */ | 144 | char prev_status, diff_status; /* used for TIOCMIWAIT */ |
145 | /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */ | 145 | /* we pass a pointer to this as the arguement sent to cypress_set_termios old_termios */ |
146 | struct termios tmp_termios; /* stores the old termios settings */ | 146 | struct ktermios tmp_termios; /* stores the old termios settings */ |
147 | }; | 147 | }; |
148 | 148 | ||
149 | /* write buffer structure */ | 149 | /* write buffer structure */ |
@@ -165,7 +165,7 @@ static int cypress_write (struct usb_serial_port *port, const unsigned char *b | |||
165 | static void cypress_send (struct usb_serial_port *port); | 165 | static void cypress_send (struct usb_serial_port *port); |
166 | static int cypress_write_room (struct usb_serial_port *port); | 166 | static int cypress_write_room (struct usb_serial_port *port); |
167 | static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); | 167 | static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); |
168 | static void cypress_set_termios (struct usb_serial_port *port, struct termios * old); | 168 | static void cypress_set_termios (struct usb_serial_port *port, struct ktermios * old); |
169 | static int cypress_tiocmget (struct usb_serial_port *port, struct file *file); | 169 | static int cypress_tiocmget (struct usb_serial_port *port, struct file *file); |
170 | static int cypress_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); | 170 | static int cypress_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); |
171 | static int cypress_chars_in_buffer (struct usb_serial_port *port); | 171 | static int cypress_chars_in_buffer (struct usb_serial_port *port); |
@@ -193,6 +193,7 @@ static struct usb_serial_driver cypress_earthmate_device = { | |||
193 | .name = "earthmate", | 193 | .name = "earthmate", |
194 | }, | 194 | }, |
195 | .description = "DeLorme Earthmate USB", | 195 | .description = "DeLorme Earthmate USB", |
196 | .usb_driver = &cypress_driver, | ||
196 | .id_table = id_table_earthmate, | 197 | .id_table = id_table_earthmate, |
197 | .num_interrupt_in = 1, | 198 | .num_interrupt_in = 1, |
198 | .num_interrupt_out = 1, | 199 | .num_interrupt_out = 1, |
@@ -222,6 +223,7 @@ static struct usb_serial_driver cypress_hidcom_device = { | |||
222 | .name = "cyphidcom", | 223 | .name = "cyphidcom", |
223 | }, | 224 | }, |
224 | .description = "HID->COM RS232 Adapter", | 225 | .description = "HID->COM RS232 Adapter", |
226 | .usb_driver = &cypress_driver, | ||
225 | .id_table = id_table_cyphidcomrs232, | 227 | .id_table = id_table_cyphidcomrs232, |
226 | .num_interrupt_in = 1, | 228 | .num_interrupt_in = 1, |
227 | .num_interrupt_out = 1, | 229 | .num_interrupt_out = 1, |
@@ -251,6 +253,7 @@ static struct usb_serial_driver cypress_ca42v2_device = { | |||
251 | .name = "nokiaca42v2", | 253 | .name = "nokiaca42v2", |
252 | }, | 254 | }, |
253 | .description = "Nokia CA-42 V2 Adapter", | 255 | .description = "Nokia CA-42 V2 Adapter", |
256 | .usb_driver = &cypress_driver, | ||
254 | .id_table = id_table_nokiaca42v2, | 257 | .id_table = id_table_nokiaca42v2, |
255 | .num_interrupt_in = 1, | 258 | .num_interrupt_in = 1, |
256 | .num_interrupt_out = 1, | 259 | .num_interrupt_out = 1, |
@@ -949,28 +952,13 @@ static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsi | |||
949 | 952 | ||
950 | switch (cmd) { | 953 | switch (cmd) { |
951 | case TIOCGSERIAL: | 954 | case TIOCGSERIAL: |
952 | if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct termios))) { | 955 | if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct ktermios))) { |
953 | return -EFAULT; | 956 | return -EFAULT; |
954 | } | 957 | } |
955 | return (0); | 958 | return (0); |
956 | break; | 959 | break; |
957 | case TIOCSSERIAL: | 960 | case TIOCSSERIAL: |
958 | if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct termios))) { | 961 | if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct ktermios))) { |
959 | return -EFAULT; | ||
960 | } | ||
961 | /* here we need to call cypress_set_termios to invoke the new settings */ | ||
962 | cypress_set_termios(port, &priv->tmp_termios); | ||
963 | return (0); | ||
964 | break; | ||
965 | /* these are called when setting baud rate from gpsd */ | ||
966 | case TCGETS: | ||
967 | if (copy_to_user((void __user *)arg, port->tty->termios, sizeof(struct termios))) { | ||
968 | return -EFAULT; | ||
969 | } | ||
970 | return (0); | ||
971 | break; | ||
972 | case TCSETS: | ||
973 | if (copy_from_user(port->tty->termios, (void __user *)arg, sizeof(struct termios))) { | ||
974 | return -EFAULT; | 962 | return -EFAULT; |
975 | } | 963 | } |
976 | /* here we need to call cypress_set_termios to invoke the new settings */ | 964 | /* here we need to call cypress_set_termios to invoke the new settings */ |
@@ -1019,7 +1007,7 @@ static int cypress_ioctl (struct usb_serial_port *port, struct file * file, unsi | |||
1019 | 1007 | ||
1020 | 1008 | ||
1021 | static void cypress_set_termios (struct usb_serial_port *port, | 1009 | static void cypress_set_termios (struct usb_serial_port *port, |
1022 | struct termios *old_termios) | 1010 | struct ktermios *old_termios) |
1023 | { | 1011 | { |
1024 | struct cypress_private *priv = usb_get_serial_port_data(port); | 1012 | struct cypress_private *priv = usb_get_serial_port_data(port); |
1025 | struct tty_struct *tty; | 1013 | struct tty_struct *tty; |
@@ -1493,7 +1481,7 @@ static struct cypress_buf *cypress_buf_alloc(unsigned int size) | |||
1493 | if (size == 0) | 1481 | if (size == 0) |
1494 | return NULL; | 1482 | return NULL; |
1495 | 1483 | ||
1496 | cb = (struct cypress_buf *)kmalloc(sizeof(struct cypress_buf), GFP_KERNEL); | 1484 | cb = kmalloc(sizeof(struct cypress_buf), GFP_KERNEL); |
1497 | if (cb == NULL) | 1485 | if (cb == NULL) |
1498 | return NULL; | 1486 | return NULL; |
1499 | 1487 | ||