diff options
author | Johan Hovold <jhovold@gmail.com> | 2012-05-29 17:57:52 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-22 11:34:14 -0700 |
commit | 41a38d50056968f3032b9e683765b37b4ed5f973 (patch) | |
tree | fa9016a9c7021ef43280e09742a9f967fea90f0a /drivers/usb | |
parent | 9a838fe731e81658fe92d0a0b134de687e97a37d (diff) | |
download | kernel_samsung_smdk4412-41a38d50056968f3032b9e683765b37b4ed5f973.tar.gz kernel_samsung_smdk4412-41a38d50056968f3032b9e683765b37b4ed5f973.tar.bz2 kernel_samsung_smdk4412-41a38d50056968f3032b9e683765b37b4ed5f973.zip |
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.c | 34 |
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 = { static int debug; -/* per port private data */ - -#define N_IN_URB 4 -#define N_OUT_URB 4 -#define IN_BUFLEN 4096 -#define OUT_BUFLEN 4096 - -struct option_port_private { - /* Input endpoints and buffer for this port */ - struct urb *in_urbs[N_IN_URB]; - u8 *in_buffer[N_IN_URB]; - /* Output endpoints and buffer for this port */ - struct urb *out_urbs[N_OUT_URB]; - u8 *out_buffer[N_OUT_URB]; - unsigned long out_busy; /* Bit vector of URBs in use */ - int opened; - struct usb_anchor delayed; - - /* Settings for the port */ - int rts_state; /* Handshaking pins (outputs) */ - int dtr_state; - int cts_state; /* Handshaking pins (inputs) */ - int dsr_state; - int dcd_state; - int ri_state; - - unsigned long tx_start_time[N_OUT_URB]; -}; - /* Functions used by new usb-serial code. */ static int __init option_init(void) { @@ -1424,7 +1395,8 @@ static void option_instat_callback(struct urb *urb) int err; int status = urb->status; struct usb_serial_port *port = urb->context; - struct option_port_private *portdata = usb_get_serial_port_data(port); + struct usb_wwan_port_private *portdata = + usb_get_serial_port_data(port); dbg("%s", __func__); 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) struct usb_serial *serial = port->serial; struct usb_wwan_intf_private *intfdata = (struct usb_wwan_intf_private *) serial->private; - struct option_port_private *portdata; + struct usb_wwan_port_private *portdata; int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; int val = 0; dbg("%s", __func__); |