Subject: [PATCH 001/008] [RESUBMIT] USB: serial: adding sierra_release_urb() function From: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx> The following is summary of changes we have made to sierra.c driver in [PATCH 001/008] from the series dealing with improving urb handling: - Added function sierra_release_urb() to free an urb and its transfer buffer. This function is to be called by sierra_close() in subsequent patch. - Version number set to 1.3.8 - Removed unecessary include file reference and comment Signed-off-by: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx> --- drivers/usb/serial/sierra.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) --- a/drivers/usb/serial/sierra.c 2009-05-04 14:07:33.000000000 -0700 +++ b/drivers/usb/serial/sierra.c 2009-05-04 17:20:29.000000000 -0700 @@ -17,7 +17,7 @@ Whom based his on the Keyspan driver by Hugh Blemings <hugh@xxxxxxxxxxxx> */ -#define DRIVER_VERSION "v.1.3.7" +#define DRIVER_VERSION "v.1.3.8" #define DRIVER_AUTHOR "Kevin Lloyd, Elina Pasheva, Matthew Safar, Rory Filer" #define DRIVER_DESC "USB Driver for Sierra Wireless USB modems" @@ -29,12 +29,10 @@ #include <linux/module.h> #include <linux/usb.h> #include <linux/usb/serial.h> -#include <linux/usb/ch9.h> #define SWIMS_USB_REQUEST_SetPower 0x00 #define SWIMS_USB_REQUEST_SetNmea 0x07 -/* per port private data */ #define N_IN_URB 8 #define N_OUT_URB 64 #define IN_BUFLEN 4096 @@ -248,7 +246,6 @@ static struct usb_driver sierra_driver = .id_table = id_table, .no_dynamic_id = 1, }; - struct sierra_port_private { spinlock_t lock; /* lock the structure */ int outstanding_urbs; /* number of out urbs in flight */ @@ -364,6 +361,17 @@ static int sierra_tiocmset(struct tty_st return sierra_send_setup(port); } +static void sierra_release_urb(struct urb *urb) +{ + struct usb_serial_port *port; + if (urb) { + port = urb->context; + dev_dbg(&port->dev, "%s: %p\n", __func__, urb); + kfree(urb->transfer_buffer); + usb_free_urb(urb); + } +} + static void sierra_outdat_callback(struct urb *urb) { struct usb_serial_port *port = urb->context; -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html