aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cypress_m8.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/cypress_m8.c')
-rw-r--r--drivers/usb/serial/cypress_m8.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index afc886c75d2f..b78c34eb5d3f 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -89,13 +89,6 @@ static const struct usb_device_id id_table_combined[] = {
89 89
90MODULE_DEVICE_TABLE(usb, id_table_combined); 90MODULE_DEVICE_TABLE(usb, id_table_combined);
91 91
92static struct usb_driver cypress_driver = {
93 .name = "cypress",
94 .probe = usb_serial_probe,
95 .disconnect = usb_serial_disconnect,
96 .id_table = id_table_combined,
97};
98
99enum packet_format { 92enum packet_format {
100 packet_format_1, /* b0:status, b1:payload count */ 93 packet_format_1, /* b0:status, b1:payload count */
101 packet_format_2 /* b0[7:3]:status, b0[2:0]:payload count */ 94 packet_format_2 /* b0[7:3]:status, b0[2:0]:payload count */
@@ -305,8 +298,6 @@ static int cypress_serial_control(struct tty_struct *tty,
305 const unsigned int feature_len = 5; 298 const unsigned int feature_len = 5;
306 unsigned long flags; 299 unsigned long flags;
307 300
308 dbg("%s", __func__);
309
310 priv = usb_get_serial_port_data(port); 301 priv = usb_get_serial_port_data(port);
311 302
312 if (!priv->comm_is_ok) 303 if (!priv->comm_is_ok)
@@ -451,8 +442,6 @@ static int generic_startup(struct usb_serial *serial)
451 struct cypress_private *priv; 442 struct cypress_private *priv;
452 struct usb_serial_port *port = serial->port[0]; 443 struct usb_serial_port *port = serial->port[0];
453 444
454 dbg("%s - port %d", __func__, port->number);
455
456 priv = kzalloc(sizeof(struct cypress_private), GFP_KERNEL); 445 priv = kzalloc(sizeof(struct cypress_private), GFP_KERNEL);
457 if (!priv) 446 if (!priv)
458 return -ENOMEM; 447 return -ENOMEM;
@@ -505,8 +494,6 @@ static int cypress_earthmate_startup(struct usb_serial *serial)
505 struct cypress_private *priv; 494 struct cypress_private *priv;
506 struct usb_serial_port *port = serial->port[0]; 495 struct usb_serial_port *port = serial->port[0];
507 496
508 dbg("%s", __func__);
509
510 if (generic_startup(serial)) { 497 if (generic_startup(serial)) {
511 dbg("%s - Failed setting up port %d", __func__, 498 dbg("%s - Failed setting up port %d", __func__,
512 port->number); 499 port->number);
@@ -537,8 +524,6 @@ static int cypress_hidcom_startup(struct usb_serial *serial)
537{ 524{
538 struct cypress_private *priv; 525 struct cypress_private *priv;
539 526
540 dbg("%s", __func__);
541
542 if (generic_startup(serial)) { 527 if (generic_startup(serial)) {
543 dbg("%s - Failed setting up port %d", __func__, 528 dbg("%s - Failed setting up port %d", __func__,
544 serial->port[0]->number); 529 serial->port[0]->number);
@@ -556,8 +541,6 @@ static int cypress_ca42v2_startup(struct usb_serial *serial)
556{ 541{
557 struct cypress_private *priv; 542 struct cypress_private *priv;
558 543
559 dbg("%s", __func__);
560
561 if (generic_startup(serial)) { 544 if (generic_startup(serial)) {
562 dbg("%s - Failed setting up port %d", __func__, 545 dbg("%s - Failed setting up port %d", __func__,
563 serial->port[0]->number); 546 serial->port[0]->number);
@@ -575,10 +558,7 @@ static void cypress_release(struct usb_serial *serial)
575{ 558{
576 struct cypress_private *priv; 559 struct cypress_private *priv;
577 560
578 dbg("%s - port %d", __func__, serial->port[0]->number);
579
580 /* all open ports are closed at this point */ 561 /* all open ports are closed at this point */
581
582 priv = usb_get_serial_port_data(serial->port[0]); 562 priv = usb_get_serial_port_data(serial->port[0]);
583 563
584 if (priv) { 564 if (priv) {
@@ -595,8 +575,6 @@ static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port)
595 unsigned long flags; 575 unsigned long flags;
596 int result = 0; 576 int result = 0;
597 577
598 dbg("%s - port %d", __func__, port->number);
599
600 if (!priv->comm_is_ok) 578 if (!priv->comm_is_ok)
601 return -EIO; 579 return -EIO;
602 580
@@ -661,8 +639,6 @@ static void cypress_close(struct usb_serial_port *port)
661 struct cypress_private *priv = usb_get_serial_port_data(port); 639 struct cypress_private *priv = usb_get_serial_port_data(port);
662 unsigned long flags; 640 unsigned long flags;
663 641
664 dbg("%s - port %d", __func__, port->number);
665
666 /* writing is potentially harmful, lock must be taken */ 642 /* writing is potentially harmful, lock must be taken */
667 mutex_lock(&port->serial->disc_mutex); 643 mutex_lock(&port->serial->disc_mutex);
668 if (port->serial->disconnected) { 644 if (port->serial->disconnected) {
@@ -720,7 +696,6 @@ static void cypress_send(struct usb_serial_port *port)
720 if (!priv->comm_is_ok) 696 if (!priv->comm_is_ok)
721 return; 697 return;
722 698
723 dbg("%s - port %d", __func__, port->number);
724 dbg("%s - interrupt out size is %d", __func__, 699 dbg("%s - interrupt out size is %d", __func__,
725 port->interrupt_out_size); 700 port->interrupt_out_size);
726 701
@@ -828,8 +803,6 @@ static int cypress_write_room(struct tty_struct *tty)
828 int room = 0; 803 int room = 0;
829 unsigned long flags; 804 unsigned long flags;
830 805
831 dbg("%s - port %d", __func__, port->number);
832
833 spin_lock_irqsave(&priv->lock, flags); 806 spin_lock_irqsave(&priv->lock, flags);
834 room = kfifo_avail(&priv->write_fifo); 807 room = kfifo_avail(&priv->write_fifo);
835 spin_unlock_irqrestore(&priv->lock, flags); 808 spin_unlock_irqrestore(&priv->lock, flags);
@@ -847,8 +820,6 @@ static int cypress_tiocmget(struct tty_struct *tty)
847 unsigned int result = 0; 820 unsigned int result = 0;
848 unsigned long flags; 821 unsigned long flags;
849 822
850 dbg("%s - port %d", __func__, port->number);
851
852 spin_lock_irqsave(&priv->lock, flags); 823 spin_lock_irqsave(&priv->lock, flags);
853 control = priv->line_control; 824 control = priv->line_control;
854 status = priv->current_status; 825 status = priv->current_status;
@@ -874,8 +845,6 @@ static int cypress_tiocmset(struct tty_struct *tty,
874 struct cypress_private *priv = usb_get_serial_port_data(port); 845 struct cypress_private *priv = usb_get_serial_port_data(port);
875 unsigned long flags; 846 unsigned long flags;
876 847
877 dbg("%s - port %d", __func__, port->number);
878
879 spin_lock_irqsave(&priv->lock, flags); 848 spin_lock_irqsave(&priv->lock, flags);
880 if (set & TIOCM_RTS) 849 if (set & TIOCM_RTS)
881 priv->line_control |= CONTROL_RTS; 850 priv->line_control |= CONTROL_RTS;
@@ -948,8 +917,6 @@ static void cypress_set_termios(struct tty_struct *tty,
948 __u8 oldlines; 917 __u8 oldlines;
949 int linechange = 0; 918 int linechange = 0;
950 919
951 dbg("%s - port %d", __func__, port->number);
952
953 spin_lock_irqsave(&priv->lock, flags); 920 spin_lock_irqsave(&priv->lock, flags);
954 /* We can't clean this one up as we don't know the device type 921 /* We can't clean this one up as we don't know the device type
955 early enough */ 922 early enough */
@@ -1096,8 +1063,6 @@ static int cypress_chars_in_buffer(struct tty_struct *tty)
1096 int chars = 0; 1063 int chars = 0;
1097 unsigned long flags; 1064 unsigned long flags;
1098 1065
1099 dbg("%s - port %d", __func__, port->number);
1100
1101 spin_lock_irqsave(&priv->lock, flags); 1066 spin_lock_irqsave(&priv->lock, flags);
1102 chars = kfifo_len(&priv->write_fifo); 1067 chars = kfifo_len(&priv->write_fifo);
1103 spin_unlock_irqrestore(&priv->lock, flags); 1068 spin_unlock_irqrestore(&priv->lock, flags);
@@ -1112,8 +1077,6 @@ static void cypress_throttle(struct tty_struct *tty)
1112 struct usb_serial_port *port = tty->driver_data; 1077 struct usb_serial_port *port = tty->driver_data;
1113 struct cypress_private *priv = usb_get_serial_port_data(port); 1078 struct cypress_private *priv = usb_get_serial_port_data(port);
1114 1079
1115 dbg("%s - port %d", __func__, port->number);
1116
1117 spin_lock_irq(&priv->lock); 1080 spin_lock_irq(&priv->lock);
1118 priv->rx_flags = THROTTLED; 1081 priv->rx_flags = THROTTLED;
1119 spin_unlock_irq(&priv->lock); 1082 spin_unlock_irq(&priv->lock);
@@ -1126,8 +1089,6 @@ static void cypress_unthrottle(struct tty_struct *tty)
1126 struct cypress_private *priv = usb_get_serial_port_data(port); 1089 struct cypress_private *priv = usb_get_serial_port_data(port);
1127 int actually_throttled, result; 1090 int actually_throttled, result;
1128 1091
1129 dbg("%s - port %d", __func__, port->number);
1130
1131 spin_lock_irq(&priv->lock); 1092 spin_lock_irq(&priv->lock);
1132 actually_throttled = priv->rx_flags & ACTUALLY_THROTTLED; 1093 actually_throttled = priv->rx_flags & ACTUALLY_THROTTLED;
1133 priv->rx_flags = 0; 1094 priv->rx_flags = 0;
@@ -1161,8 +1122,6 @@ static void cypress_read_int_callback(struct urb *urb)
1161 int i = 0; 1122 int i = 0;
1162 int status = urb->status; 1123 int status = urb->status;
1163 1124
1164 dbg("%s - port %d", __func__, port->number);
1165
1166 switch (status) { 1125 switch (status) {
1167 case 0: /* success */ 1126 case 0: /* success */
1168 break; 1127 break;
@@ -1303,8 +1262,6 @@ static void cypress_write_int_callback(struct urb *urb)
1303 int result; 1262 int result;
1304 int status = urb->status; 1263 int status = urb->status;
1305 1264
1306 dbg("%s - port %d", __func__, port->number);
1307
1308 switch (status) { 1265 switch (status) {
1309 case 0: 1266 case 0:
1310 /* success */ 1267 /* success */
@@ -1346,7 +1303,7 @@ static void cypress_write_int_callback(struct urb *urb)
1346 cypress_send(port); 1303 cypress_send(port);
1347} 1304}
1348 1305
1349module_usb_serial_driver(cypress_driver, serial_drivers); 1306module_usb_serial_driver(serial_drivers, id_table_combined);
1350 1307
1351MODULE_AUTHOR(DRIVER_AUTHOR); 1308MODULE_AUTHOR(DRIVER_AUTHOR);
1352MODULE_DESCRIPTION(DRIVER_DESC); 1309MODULE_DESCRIPTION(DRIVER_DESC);