aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cyberjack.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/cyberjack.c')
-rw-r--r--drivers/usb/serial/cyberjack.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 933ba913e66c..336523fd7366 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -58,7 +58,8 @@ static int debug;
58 58
59/* Function prototypes */ 59/* Function prototypes */
60static int cyberjack_startup(struct usb_serial *serial); 60static int cyberjack_startup(struct usb_serial *serial);
61static void cyberjack_shutdown(struct usb_serial *serial); 61static void cyberjack_disconnect(struct usb_serial *serial);
62static void cyberjack_release(struct usb_serial *serial);
62static int cyberjack_open(struct tty_struct *tty, 63static int cyberjack_open(struct tty_struct *tty,
63 struct usb_serial_port *port, struct file *filp); 64 struct usb_serial_port *port, struct file *filp);
64static void cyberjack_close(struct usb_serial_port *port); 65static void cyberjack_close(struct usb_serial_port *port);
@@ -94,7 +95,8 @@ static struct usb_serial_driver cyberjack_device = {
94 .id_table = id_table, 95 .id_table = id_table,
95 .num_ports = 1, 96 .num_ports = 1,
96 .attach = cyberjack_startup, 97 .attach = cyberjack_startup,
97 .shutdown = cyberjack_shutdown, 98 .disconnect = cyberjack_disconnect,
99 .release = cyberjack_release,
98 .open = cyberjack_open, 100 .open = cyberjack_open,
99 .close = cyberjack_close, 101 .close = cyberjack_close,
100 .write = cyberjack_write, 102 .write = cyberjack_write,
@@ -148,17 +150,25 @@ static int cyberjack_startup(struct usb_serial *serial)
148 return 0; 150 return 0;
149} 151}
150 152
151static void cyberjack_shutdown(struct usb_serial *serial) 153static void cyberjack_disconnect(struct usb_serial *serial)
152{ 154{
153 int i; 155 int i;
154 156
155 dbg("%s", __func__); 157 dbg("%s", __func__);
156 158
157 for (i = 0; i < serial->num_ports; ++i) { 159 for (i = 0; i < serial->num_ports; ++i)
158 usb_kill_urb(serial->port[i]->interrupt_in_urb); 160 usb_kill_urb(serial->port[i]->interrupt_in_urb);
161}
162
163static void cyberjack_release(struct usb_serial *serial)
164{
165 int i;
166
167 dbg("%s", __func__);
168
169 for (i = 0; i < serial->num_ports; ++i) {
159 /* My special items, the standard routines free my urbs */ 170 /* My special items, the standard routines free my urbs */
160 kfree(usb_get_serial_port_data(serial->port[i])); 171 kfree(usb_get_serial_port_data(serial->port[i]));
161 usb_set_serial_port_data(serial->port[i], NULL);
162 } 172 }
163} 173}
164 174