aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/belkin_sa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/belkin_sa.c')
-rw-r--r--drivers/usb/serial/belkin_sa.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index a52e0d2cec31..6b7365632951 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -2,17 +2,17 @@
2 * Belkin USB Serial Adapter Driver 2 * Belkin USB Serial Adapter Driver
3 * 3 *
4 * Copyright (C) 2000 William Greathouse (wgreathouse@smva.com) 4 * Copyright (C) 2000 William Greathouse (wgreathouse@smva.com)
5 * Copyright (C) 2000-2001 Greg Kroah-Hartman (greg@kroah.com) 5 * Copyright (C) 2000-2001 Greg Kroah-Hartman (greg@kroah.com)
6 * Copyright (C) 2010 Johan Hovold (jhovold@gmail.com) 6 * Copyright (C) 2010 Johan Hovold (jhovold@gmail.com)
7 * 7 *
8 * This program is largely derived from work by the linux-usb group 8 * This program is largely derived from work by the linux-usb group
9 * and associated source files. Please see the usb/serial files for 9 * and associated source files. Please see the usb/serial files for
10 * individual credits and copyrights. 10 * individual credits and copyrights.
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by 13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or 14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version. 15 * (at your option) any later version.
16 * 16 *
17 * See Documentation/usb/usb-serial.txt for more information on using this 17 * See Documentation/usb/usb-serial.txt for more information on using this
18 * driver 18 * driver
@@ -62,7 +62,7 @@ static int belkin_sa_tiocmset(struct tty_struct *tty,
62 unsigned int set, unsigned int clear); 62 unsigned int set, unsigned int clear);
63 63
64 64
65static const struct usb_device_id id_table_combined[] = { 65static const struct usb_device_id id_table[] = {
66 { USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) }, 66 { USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) },
67 { USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) }, 67 { USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) },
68 { USB_DEVICE(PERACOM_VID, PERACOM_PID) }, 68 { USB_DEVICE(PERACOM_VID, PERACOM_PID) },
@@ -71,14 +71,7 @@ static const struct usb_device_id id_table_combined[] = {
71 { USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) }, 71 { USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) },
72 { } /* Terminating entry */ 72 { } /* Terminating entry */
73}; 73};
74MODULE_DEVICE_TABLE(usb, id_table_combined); 74MODULE_DEVICE_TABLE(usb, id_table);
75
76static struct usb_driver belkin_driver = {
77 .name = "belkin",
78 .probe = usb_serial_probe,
79 .disconnect = usb_serial_disconnect,
80 .id_table = id_table_combined,
81};
82 75
83/* All of the device info needed for the serial converters */ 76/* All of the device info needed for the serial converters */
84static struct usb_serial_driver belkin_device = { 77static struct usb_serial_driver belkin_device = {
@@ -87,7 +80,7 @@ static struct usb_serial_driver belkin_device = {
87 .name = "belkin", 80 .name = "belkin",
88 }, 81 },
89 .description = "Belkin / Peracom / GoHubs USB Serial Adapter", 82 .description = "Belkin / Peracom / GoHubs USB Serial Adapter",
90 .id_table = id_table_combined, 83 .id_table = id_table,
91 .num_ports = 1, 84 .num_ports = 1,
92 .open = belkin_sa_open, 85 .open = belkin_sa_open,
93 .close = belkin_sa_close, 86 .close = belkin_sa_close,
@@ -159,8 +152,6 @@ static void belkin_sa_release(struct usb_serial *serial)
159{ 152{
160 int i; 153 int i;
161 154
162 dbg("%s", __func__);
163
164 for (i = 0; i < serial->num_ports; ++i) 155 for (i = 0; i < serial->num_ports; ++i)
165 kfree(usb_get_serial_port_data(serial->port[i])); 156 kfree(usb_get_serial_port_data(serial->port[i]));
166} 157}
@@ -170,8 +161,6 @@ static int belkin_sa_open(struct tty_struct *tty,
170{ 161{
171 int retval; 162 int retval;
172 163
173 dbg("%s port %d", __func__, port->number);
174
175 retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); 164 retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
176 if (retval) { 165 if (retval) {
177 dev_err(&port->dev, "usb_submit_urb(read int) failed\n"); 166 dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
@@ -187,8 +176,6 @@ static int belkin_sa_open(struct tty_struct *tty,
187 176
188static void belkin_sa_close(struct usb_serial_port *port) 177static void belkin_sa_close(struct usb_serial_port *port)
189{ 178{
190 dbg("%s port %d", __func__, port->number);
191
192 usb_serial_generic_close(port); 179 usb_serial_generic_close(port);
193 usb_kill_urb(port->interrupt_in_urb); 180 usb_kill_urb(port->interrupt_in_urb);
194} 181}
@@ -210,12 +197,12 @@ static void belkin_sa_read_int_callback(struct urb *urb)
210 case -ENOENT: 197 case -ENOENT:
211 case -ESHUTDOWN: 198 case -ESHUTDOWN:
212 /* this urb is terminated, clean up */ 199 /* this urb is terminated, clean up */
213 dbg("%s - urb shutting down with status: %d", 200 dev_dbg(&port->dev, "%s - urb shutting down with status: %d\n",
214 __func__, status); 201 __func__, status);
215 return; 202 return;
216 default: 203 default:
217 dbg("%s - nonzero urb status received: %d", 204 dev_dbg(&port->dev, "%s - nonzero urb status received: %d\n",
218 __func__, status); 205 __func__, status);
219 goto exit; 206 goto exit;
220 } 207 }
221 208
@@ -403,7 +390,9 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
403 case CS8: 390 case CS8:
404 urb_value = BELKIN_SA_DATA_BITS(8); 391 urb_value = BELKIN_SA_DATA_BITS(8);
405 break; 392 break;
406 default: dbg("CSIZE was not CS5-CS8, using default of 8"); 393 default:
394 dev_dbg(&port->dev,
395 "CSIZE was not CS5-CS8, using default of 8\n");
407 urb_value = BELKIN_SA_DATA_BITS(8); 396 urb_value = BELKIN_SA_DATA_BITS(8);
408 break; 397 break;
409 } 398 }
@@ -463,8 +452,6 @@ static int belkin_sa_tiocmget(struct tty_struct *tty)
463 unsigned long control_state; 452 unsigned long control_state;
464 unsigned long flags; 453 unsigned long flags;
465 454
466 dbg("%s", __func__);
467
468 spin_lock_irqsave(&priv->lock, flags); 455 spin_lock_irqsave(&priv->lock, flags);
469 control_state = priv->control_state; 456 control_state = priv->control_state;
470 spin_unlock_irqrestore(&priv->lock, flags); 457 spin_unlock_irqrestore(&priv->lock, flags);
@@ -484,8 +471,6 @@ static int belkin_sa_tiocmset(struct tty_struct *tty,
484 int rts = 0; 471 int rts = 0;
485 int dtr = 0; 472 int dtr = 0;
486 473
487 dbg("%s", __func__);
488
489 spin_lock_irqsave(&priv->lock, flags); 474 spin_lock_irqsave(&priv->lock, flags);
490 control_state = priv->control_state; 475 control_state = priv->control_state;
491 476
@@ -524,7 +509,7 @@ exit:
524 return retval; 509 return retval;
525} 510}
526 511
527module_usb_serial_driver(belkin_driver, serial_drivers); 512module_usb_serial_driver(serial_drivers, id_table);
528 513
529MODULE_AUTHOR(DRIVER_AUTHOR); 514MODULE_AUTHOR(DRIVER_AUTHOR);
530MODULE_DESCRIPTION(DRIVER_DESC); 515MODULE_DESCRIPTION(DRIVER_DESC);