aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-05-29 11:57:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-22 14:34:14 -0400
commit41a38d50056968f3032b9e683765b37b4ed5f973 (patch)
treefa9016a9c7021ef43280e09742a9f967fea90f0a /drivers/usb
parent9a838fe731e81658fe92d0a0b134de687e97a37d (diff)
USB: option: fix port-data abuse
commit 4273f9878b0a8271df055e3c8f2e7f08c6a4a2f4 upstream. Commit 8b4c6a3ab596961b78465 ("USB: option: Use generic USB wwan code") moved option port-data allocation to usb_wwan_startup but still cast the port data to the old struct... Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/option.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 63a8d3f3c0c..ce024577400 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1284,35 +1284,6 @@ static struct usb_serial_driver option_1port_device = {
1284 1284
1285static int debug; 1285static int debug;
1286 1286
1287/* per port private data */
1288
1289#define N_IN_URB 4
1290#define N_OUT_URB 4
1291#define IN_BUFLEN 4096
1292#define OUT_BUFLEN 4096
1293
1294struct option_port_private {
1295 /* Input endpoints and buffer for this port */
1296 struct urb *in_urbs[N_IN_URB];
1297 u8 *in_buffer[N_IN_URB];
1298 /* Output endpoints and buffer for this port */
1299 struct urb *out_urbs[N_OUT_URB];
1300 u8 *out_buffer[N_OUT_URB];
1301 unsigned long out_busy; /* Bit vector of URBs in use */
1302 int opened;
1303 struct usb_anchor delayed;
1304
1305 /* Settings for the port */
1306 int rts_state; /* Handshaking pins (outputs) */
1307 int dtr_state;
1308 int cts_state; /* Handshaking pins (inputs) */
1309 int dsr_state;
1310 int dcd_state;
1311 int ri_state;
1312
1313 unsigned long tx_start_time[N_OUT_URB];
1314};
1315
1316/* Functions used by new usb-serial code. */ 1287/* Functions used by new usb-serial code. */
1317static int __init option_init(void) 1288static int __init option_init(void)
1318{ 1289{
@@ -1424,7 +1395,8 @@ static void option_instat_callback(struct urb *urb)
1424 int err; 1395 int err;
1425 int status = urb->status; 1396 int status = urb->status;
1426 struct usb_serial_port *port = urb->context; 1397 struct usb_serial_port *port = urb->context;
1427 struct option_port_private *portdata = usb_get_serial_port_data(port); 1398 struct usb_wwan_port_private *portdata =
1399 usb_get_serial_port_data(port);
1428 1400
1429 dbg("%s", __func__); 1401 dbg("%s", __func__);
1430 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); 1402 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata);
@@ -1485,7 +1457,7 @@ static int option_send_setup(struct usb_serial_port *port)
1485 struct usb_serial *serial = port->serial; 1457 struct usb_serial *serial = port->serial;
1486 struct usb_wwan_intf_private *intfdata = 1458 struct usb_wwan_intf_private *intfdata =
1487 (struct usb_wwan_intf_private *) serial->private; 1459 (struct usb_wwan_intf_private *) serial->private;
1488 struct option_port_private *portdata; 1460 struct usb_wwan_port_private *portdata;
1489 int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; 1461 int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
1490 int val = 0; 1462 int val = 0;
1491 dbg("%s", __func__); 1463 dbg("%s", __func__);